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

= Normal-normal conjugacy with known observation variance

= Normal-normal conjugacy
{synonym}

For <independent random variables>[independent] $X_i\sim N(\theta,\sigma^2)$ with known $\sigma^2>0$ and <prior distribution>[prior] $\theta\sim N(\mu,\nu^2)$ with fixed $\nu^2>0$, the <posterior distribution>[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 <credible interval>[posterior credible intervals] agree asymptotically with the corresponding known-variance <confidence interval>[confidence intervals].