Poisson-gamma conjugacy with unequal exposures (source code)

= Poisson-gamma conjugacy with unequal exposures
{c}
{title2=$\Theta\mid\mathbf Y\sim\operatorname{Gamma}(\alpha+\sum_jY_j,\beta+\sum_jm_j)$}

Given $\Theta$, independent observations $Y_j$ have <Poisson distribution> with means $m_j\Theta$ for known exposures. A <gamma distribution> prior of shape $\alpha$ and rate $\beta$ yields a gamma posterior with shape $\alpha+\sum_jY_j$ and rate $\beta+\sum_jm_j$. The likelihood kernel is $\theta^{\sum_jY_j}e^{-\theta\sum_jm_j}$. Thus the <posterior mean> depends on total claims and total exposure, not the number of periods alone.