Gamma random-intercept Poisson model (source code)

= Gamma random-intercept Poisson model
{title2=$Y_{ij}\mid U_i\sim\operatorname{Poisson}(U_i a_{ij})$}

Let the positive multiplier $U_i$ have a <gamma distribution> with mean $\tau$ and <variance> $\theta$, and conditionally let the repeated counts be <independent> with means $U_i a_{ij}$. Total <expectation> and <variance> give
$$
\mathbb EY_{ij}=\tau a_{ij},\qquad
\operatorname{Var}(Y_{ij})=\tau a_{ij}+\theta a_{ij}^2,\qquad
\operatorname{Cov}(Y_{ij},Y_{ik})=\theta a_{ij}a_{ik}\quad(j\ne k).
$$
The <Poisson-gamma mixture> gives negative-binomial marginal counts of size $\tau^2/\theta$. Despite the shared multiplier, the marginal correlations generally depend on both marginal means and need not be exchangeable.