Solution (source code)

= Solution

In the <Bühlmann model>, one policy has a random risk parameter $\Theta$. Conditional on $\Theta$, its annual observations $X_i$ are <independent and identically distributed random variables>, with mean $m(\Theta)$ and variance $v(\Theta)$. Put $m_0=\mathbb E[m(\Theta)]$, let $v=\mathbb E[v(\Theta)]$ be the <expected process variance>, and let $a=\operatorname{Var}(m(\Theta))$ be the <variance of hypothetical means>. Assume the required second moments are finite.

The <Bühlmann credibility premium> is the best affine estimate of $m(\Theta)$ under <mean squared error>. After choosing the intercept to make the estimate unbiased, write it as $m_0+\sum_{i=1}^n b_i(X_i-m_0)$. If $B=\sum_i b_i$, the <law of total variance> and conditional independence give its error
$$
\mathbb E\left[\left(m(\Theta)-m_0-\sum_i b_i(X_i-m_0)\right)^2\right]
=a(1-B)^2+v\sum_i b_i^2.
$$
For fixed $B$, the <Cauchy-Schwarz inequality> minimizes the last sum at $b_i=B/n$. Differentiating $a(1-B)^2+vB^2/n$ gives $B=na/(na+v)$. Thus the <credibility factor> and <credibility premium> are
$$
\boxed{Z=\frac{na}{na+v}=\frac{n}{n+v/a},\qquad \widehat m=Z\overline X+(1-Z)m_0.}
$$
The ratio form assumes $a>0$; when $a=0$ and $v>0$, the conditional mean is constant and $Z=0$. Predicting $X_{n+1}$ rather than its conditional mean adds the constant $v$ to the error and leaves the optimal affine estimate unchanged.

Here the latent intensity has a <Pareto distribution> with shape three and lower bound one. For $r<3$, its moments are $\mathbb E[\Theta^r]=3\int_1^\infty\theta^{r-4}\,d\theta=3/(3-r)$. Consequently
$$
m_0=\mathbb E\Theta=\frac32,\qquad v=\mathbb E\Theta=\frac32,\qquad a=\operatorname{Var}\Theta=3-\frac94=\frac34.
$$
The equality for $v$ uses the <Poisson distribution> conditional variance $v(\Theta)=\Theta$. There are two years of experience, so $Z=1/2$ and the observed <sample mean> is $k/2$. The <Poisson credibility with a shape-three Pareto intensity> is therefore
$$
\boxed{\widehat m_{\mathrm{cred}}=\frac12\frac{k}{2}+\frac12\frac32=\frac{k+3}{4}.}
$$
In particular it equals $2$ when $k=5$.

For the exact <Bayesian credibility> estimate, the total count conditional on $\Theta=\theta$ has <Poisson distribution> of mean $2\theta$. Multiplication of its <likelihood> by the <prior distribution> density gives a <Bayesian posterior> density proportional to $\theta^{k-4}e^{-2\theta}$ on $\theta>1$. At $k=5$, its normalizing integral and first-moment integral are
$$
\int_1^\infty\theta e^{-2\theta}\,d\theta=\frac34e^{-2},\qquad
\int_1^\infty\theta^2e^{-2\theta}\,d\theta=\frac54e^{-2}.
$$
Hence the next-year predictive <expected value> is
$$
\boxed{\mathbb E[N_3\mid N_1+N_2=5]=\mathbb E[\Theta\mid N_1+N_2=5]=\frac53\ne2.}
$$
The <Bühlmann credibility premium> optimizes over affine estimates, whereas the <Bayesian posterior> mean optimizes over all square-integrable estimates. This explains why the two <credibility estimates> need not agree for this nonconjugate prior.