Data x1,…,xn are i.i.d. N(μ,σ2) with known σ2 and prior μ∼N(μ0,τ2). What is the posterior of μ, and what is it for μ0=0, τ2=4, σ2=1, n=4, xˉ=2? Why is the MAP estimate a ridge-type shrinkage of xˉ?

Probability and statistics, Bayesian estimation
Level L3 Intermediate. Length Long. Nature Mat Mathematical.

What's being asked

Completing the square to combine Gaussian prior and likelihood, and interpreting precisions.

Key idea

Posterior precision =1τ2+nσ2 and posterior mean =μ0/τ2+nxˉ/σ21/τ2+n/σ2.

Steps

  1. Write the log-posterior up to a constant: −12σ2∑i(xi−μ)2−12τ2(μ−μ0)2.
  2. Expand in μ. Using ∑i(xi−μ)2=nμ2−2nxˉμ+const, the terms in μ2 and μ are −12(nσ2+1τ2)μ2+(nxˉσ2+μ0τ2)μ.
  3. Compare with −12Λ(μ−m)2+const to read off the precision Λ=nσ2+1τ2 and mean m=(nxˉσ2+μ0τ2)/Λ. The posterior is Gaussian.
  4. Numbers: Λ=41+14=4.25, so the posterior variance is 1/4.25≈0.235. The mean is m=(4×2+0)/4.25=8/4.25≈1.882.
  5. Interpret: m=wxˉ+(1−w)μ0 with w=n/σ2Λ=44.25≈0.941. The estimate shrinks the sample mean slightly towards μ0.
  6. Ridge link: the posterior is Gaussian, so MAP equals the mean. For μ0=0 it minimises ∑i(xi−μ)2+σ2τ2μ2, which gives μ=nxˉn+σ2/τ2=84.25, the same value, with ridge penalty σ2/τ2=0.25.

Common mistakes

How long your answer should be

One page; 8 minutes.

Last checked on 4 December 2026.

Read this

Previous in Probability and statistics: A variable is drawn from N(0,1) with probability 0.3 and from N(4,2) (variance 2) with probability 0.7. Use the law of total variance to find its mean and variance. Why is the variance more than the weighted average of the two component variances?
Next in Probability and statistics: Is it true that if X and Y are each Gaussian and uncorrelated, then they are independent, and what construction justifies your answer?