Solution (source code)

= Solution

The gamma <full conditional distribution> has mean $(y_i+1)/(1+\psi)=(y_i+1)\phi$. The <tower property> and the <beta distribution> mean give
$$
\mathbb E[\theta_i\mid y]=(y_i+1)\frac{s}{s+n}.
$$
Writing $\overline y=s/n$ and $w=s/(s+n)=\overline y/(1+\overline y)$ yields
$$
\boxed{\mathbb E[\theta_i\mid y]=w y_i+(1-w)\overline y.}
$$
Thus <partial pooling> pulls every local mean toward the overall sample mean. The common weight arises from the fixed shape-one mixing distribution; it is the <Poisson–exponential posterior shrinkage formula>.