Normal–normal Conjugate Update Explained with Worked Examples

With a normal prior (precision ) and observations with mean from , the posterior is normal with precision and mean .

Write 2x or 2*x to multiply, ^ for powers, and ; between simultaneous equations. You can also type factor, expand, derivative of, integrate … from a to b, limit … as x->0 or 15% of 80.

Try an example

Before you start

This page is easier if you are comfortable with:

What Normal–normal conjugate update means

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 and : 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 , ; data from observations with . Then and , close to the data because the data are far more precise. For , , , , : , .

As grows the posterior mean approaches and the posterior variance approaches , the variance of the sample mean (sums of independent random variables). A 95% credible interval is then , 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.

How to use normal–normal conjugate update

  1. Write the prior mean and precision , and the data precision .
  2. Compute the posterior precision .
  3. Compute the posterior mean .
  4. The posterior variance is the reciprocal of the posterior precision.

Graph

Prior N(0, 1) and posterior N(1.88, 1/17) after four precise measurementsposterior mean 1.88-3-2-10123400.20.40.60.811.21.41.61.8Prior N(0, 1) and posterior N(1.88, 1/17) after four precise measurementsμdensitypriorposteriorGraph with x from -3 to 4 and y from 0 to 1.8. Shows the curve prior; the curve posterior; point posterior mean 1.88 at (1.8824, 1.6449).

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 , ; data with , , . Find the posterior mean and precision.

Worked example
Answer
μpost=1.882, τpost=17\mu_{\text{post}}=1.882,\ \tau_{\text{post}}=17
  1. Precision
  2. Mean

Example 2: a stronger prior

Prior , ; data with , , . Find the posterior mean.

Worked example
Answer
μpost=11.636\mu_{\text{post}}=11.636
  1. Precision
  2. Mean

Example 3: weight of the prior

In the previous example find the weight given to the prior mean.

Worked example
Answer
211≈0.1818\dfrac{2}{11}\approx0.1818
  1. Weight

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.

  1. 5
  2. Check: ✓5

Mean

(0 + 20)/5.

  1. 4
  2. Check: ✓4

Precision Higher

2 + 3 × 2.

  1. 8
  2. Check: ✓8

Mean Higher

(20 + 24)/8.

  1. 5.5
  2. 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

  1. Add precisions.
  2. Weighted mean.
  3. Variance = 1/τ.
  4. More data means a tighter posterior.
  5. 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

3

3. τ_post: τ₀ = 4, n = 10, τ = 0.5 Foundation

9

4. Mean: μ₀ = 2, τ₀ = 3, n = 3, τ = 1, x̄ = 8 Higher

5

5. Posterior variance for τ_post = 4 Higher

0.25

6. Mean: μ₀ = 10, τ₀ = 1, n = 9, τ = 1, x̄ = 20 Higher

19

Practice generator

Unlimited fresh questions with instant marking. Choose a level, work it out on paper, then type your answer.

Solve: …

Key terms

Precision (τ)
1/variance.
Prior mean
μ₀.
Posterior mean
Weighted average.
Conjugate
Same family.
Sample mean
x̄.
Shrinkage
Pull toward μ₀.

Frequently asked questions

What is the posterior precision?

τ₀ + nτ.

What is the posterior mean?

(τ₀μ₀ + nτx̄)/(τ₀ + nτ).

Why precision?

Precisions add.

What happens as n grows?

The mean approaches x̄.

Which page covers weighted averages?

weighted average.

Which page covers confidence intervals?

confidence interval for a mean.

More in Advanced statistics and stochastic processes and the formula sheets.