Normal–normal Conjugate Update Explained with Worked Examples
With a normal prior μ∼N(μ0,1/τ0) (precision τ0) and n observations with mean xˉ from N(μ,1/τ), the posterior is normal with precision τpost=τ0+nτ and mean μpost=τ0+nττ0μ0+nτxˉ.
Precision is the reciprocal of the variance. The posterior mean is a weighted average of the prior mean and the sample mean, with weights equal to their precisions τ0 and nτ: the more precise source counts for more. The precisions add. This is the product of two normal densities, as in likelihood times prior, with the exponents combining by completing the square (completing the square).
Example: prior μ0=0, τ0=1; data xˉ=2 from n=4 observations with τ=4. Then τpost=1+16=17 and μpost=170+16⋅2=1.882, close to the data because the data are far more precise. For μ0=10, τ0=2, n=9, τ=1, xˉ=12: τpost=11, μpost=1120+108=11.636.
As n grows the posterior mean approaches xˉ and the posterior variance τ0+nτ1 approaches nτ1, the variance of the sample mean (sums of independent random variables). A 95% credible interval is then μpost±1.96/τpost, like a confidence interval for a mean. A discrete analogue is beta–binomial conjugacy.
What is it used for?
The posterior mean is a precision-weighted average of the prior mean and the data, and the precisions add.
Combining a prior estimate with new measurements.
Sensor fusion and tracking.
Bayesian estimation of a mean.
How to use normal–normal conjugate update
Write the prior mean μ0 and precision τ0, and the data precision τ=1/σ2.
Compute the posterior precision τ0+nτ.
Compute the posterior mean τ0+nττ0μ0+nτxˉ.
The posterior variance is the reciprocal of the posterior precision.
Graph
The posterior is much narrower and centred near the data mean 2.
Worked examples
These examples are worked by hand, step by step, so you can compare your own working.
Example 1: data dominate
Prior μ0=0, τ0=1; data with n=4, τ=4, xˉ=2. Find the posterior mean and precision.
Worked example
Answer
μpost=1.882,τpost=17
Precision
1+4⋅4=17
Mean
170+16⋅2
Example 2: a stronger prior
Prior μ0=10, τ0=2; data with n=9, τ=1, xˉ=12. Find the posterior mean.
Worked example
Answer
μpost=11.636
Precision
2+9=11
Mean
112⋅10+9⋅12
Example 3: weight of the prior
In the previous example find the weight given to the prior mean.
Worked example
Answer
112≈0.1818
Weight
τ0+nττ0=112
Special cases
A few situations come up again and again. Knowing them saves time and helps you spot answers that cannot be right.
μ₀ = 0, τ₀ = 1, n = 4, τ = 1, x̄ = 5
τ_post
5.
same
posterior mean
4.
μ₀ = 10, τ₀ = 2, n = 3, τ = 2, x̄ = 4
τ_post
8.
same
mean
5.5.
Word problems
τ_post = τ₀ + nτ and μ_post = (τ₀μ₀ + nτx̄)/τ_post, a precision-weighted average.
Precision
1 + 4 × 1.
5
Check: ✓5
Mean
(0 + 20)/5.
4
Check: ✓4
Precision Higher
2 + 3 × 2.
8
Check: ✓8
Mean Higher
(20 + 24)/8.
5.5
Check: ✓5.5
Common mistakes
Using variances
σ² ✗
precision 1/σ² ✓
Add precisions.
Simple average of means
(μ₀ + x̄)/2 ✗
precision-weighted ✓
Weights.
Forgetting n
τ₀ + τ ✗
τ₀ + nτ ✓
n observations.
Posterior variance = prior
unchanged ✗
smaller ✓
More information.
Exam tips
Add precisions.
Weighted mean.
Variance = 1/τ.
More data means a tighter posterior.
Compare with x̄.
Practice questions
Try each one on paper, then open the answer. Use the solver above to see the full working.
1. τ_post: τ₀ = 2, n = 5, τ = 1 Foundation
7
2. Mean: μ₀ = 0, τ₀ = 1, n = 1, τ = 1, x̄ = 6 Foundation