Gaussian normal-mean shrinkage Bayes estimator (source code)

= Gaussian normal-mean shrinkage Bayes estimator

For $X\mid\theta\sim N_p(\theta,I_p)$ and $\theta\sim N_p(0,c^2I_p)$, the posterior is
$$
\theta\mid X
\sim N_p\left(\frac{c^2}{1+c^2}X,
\frac{c^2}{1+c^2}I_p\right).
$$
The Bayes estimator under <quadratic loss> is the posterior mean and its Bayes risk is the trace of the posterior covariance, $pc^2/(1+c^2)$.