Normal-normal conjugacy with known observation variance (source code)

= Normal-normal conjugacy with known observation variance

= Normal-normal conjugacy
{synonym}

For independent $X_i\sim N(\theta,\sigma^2)$ and prior $\theta\sim N(\mu,\nu^2)$, the posterior has variance and mean
$$
v_n=\left(\frac n{\sigma^2}+\frac1{\nu^2}\right)^{-1},
\qquad
m_n=v_n\left(\frac{n\overline X}{\sigma^2}+\frac\mu{\nu^2}\right).
$$
As $n\to\infty$, $m_n-\overline X=O_p(n^{-1})$ and $v_n^{1/2}\sim\sigma/\sqrt n$, so fixed-level posterior credible intervals agree asymptotically with the corresponding known-variance confidence intervals.