The data are x1,…,xn∼N(μ,σ2) with known σ2=1, and the prior is μ∼N(0, 4). For n=4 and sample mean xˉ=2, what is the posterior of μ and what is the predictive distribution of a new observation? How do you show that the posterior mean is a precision-weighted average?

Probabilistic models, Conjugate priors
Level L3 Intermediate. Length Medium. Nature Mat Mathematical.

What's being asked

Whether you can complete the square to get the Gaussian posterior and see that precisions add.

Key idea

Precision is inverse variance. Posterior precision = prior precision + n/σ2, and the posterior mean is the precision-weighted average of the prior mean and the sample mean.

Steps

  1. Write log⁡p(μ∣x)=−(μ−μ0)22τ02−12σ2∑i(xi−μ)2+const, with μ0=0 and τ02=4.
  2. Collect the μ2 terms: coefficient −12(1τ02+nσ2). So the posterior precision is λn=1τ02+nσ2=0.25+4=4.25.
  3. Collect the linear terms: μ(μ0τ02+nxˉσ2). Complete the square to get μn=μ0/τ02+nxˉ/σ2λn.
  4. Numbers: μn=0⋅0.25+4⋅24.25=84.25≈1.882 and variance 1/4.25≈0.235. So μ∣x∼N(1.882, 0.235).
  5. Weighted-average view: μn=0.254.25μ0+44.25xˉ. The data get weight 94% and the prior 6%. As n→∞ the data win and the posterior mean tends to xˉ.
  6. Predictive: xnew=μ+ϵ with ϵ∼N(0,σ2) independent of μ∣x. So it is N(μn, σ2+1/λn)=N(1.882, 1.235). The extra 0.235 is uncertainty about μ.

Common mistakes

How long your answer should be

Half a page; 4–5 minutes.

Last checked on 4 December 2026.

Read this

Previous in Probabilistic models: In collapsed Gibbs sampling for LDA, the topic zi of a word is resampled from p(zi=k∣z−i,w)∝(ndk−i+α) nkw−i+βnk−i+Vβ. Where does each factor come from? What is its value for K=2, V=3, α=0.1, β=0.5, with nd⋅−i=(3,1), n⋅w−i=(4,0) and n⋅−i=(10,6)?
Next in Probabilistic models: In the Bayesian network with edges A→C, B→C, C→D, E→D and D→F, what is the Markov blanket of C? Prove from the factorisation that C is independent of all other variables given its blanket. Why is the co-parent E included?