Skip to content
Tactiverge

School/✦ Research Engineer/Week 13

The conjugate normal update

Your map says the crater is 20 m away (± 3 m). The lidar says 24 m (± 2 m). Where is it, and how sure are you now?

About 40 min · 3 goals · Checked by automated tests

1.Why should I care?

When everything is Gaussian, Bayes' rule collapses to two lines of arithmetic. Those two lines are the heart of every Kalman filter flying today. Derive them once and the filter will never be a black box.

  • ◇ Multiply a normal prior by a normal likelihood to get a normal posterior.
  • ◇ Compute the posterior mean as a precision-weighted average and the posterior variance.
  • ◇ Recognise the update as the measurement step of a Kalman filter.

2.Predict

Prior N(20, 3²) and measurement 24 with σ = 2. The posterior mean is…

Guess first. Being wrong here is how the surprise works.

3.Discover

Treat sensor 1 as the prior (z₁ = 20, σ₁ = 3) and sensor 2 as the lidar (z₂ = 24, σ₂ = 2). Snap w to the optimum: the fused curve is the posterior. Check the readout against 22.77 m and 1.66 m.

Loading the interactive…

Can't use the interactive? Read a description instead

The fusion diagram plots two normal curves and their optimal combination; the readout states the fused mean and σ, which equal the posterior here (22.77 m and 1.66 m for the suggested values).

4.Checkpoint: guided practice

Check what you just discovered before going on. Hints appear after a wrong answer.

Practice 1

Prior σ₀ = 4 m, measurement σ = 3 m. What is the posterior σ, in m?

m

5.Watch

→ Watch for the moment the prediction and measurement distributions are multiplied: the product is narrower than either.

Shows the Kalman filter as the product of two probability distributions, the prediction and the measurement, which is exactly our inverse-variance derivation.

Length: see YouTube · captions on YouTube · source

Nothing loads from YouTube until you press play.

The video is optional: everything you need is also in the lesson text and the interactive.

6.Understand

Precisions add

Precision is 1/σ². After the update, posterior precision = prior precision + measurement precision. The posterior σ is therefore always smaller than both σ₀ and σ: information never hurts, if the models are right.

Precision-weighted mean

The posterior mean is the average of μ₀ and z weighted by their precisions. Equivalently, start at the prior and move a fraction K = σ₀²/(σ₀² + σ²) of the way towards the measurement. z − μ₀ is the innovation: the surprise the measurement brought.

Conjugacy

A prior is conjugate to a likelihood when the posterior has the same family as the prior. Normal–normal is the most useful case: a Gaussian belief stays Gaussian after every update, so a filter only ever stores a mean and a variance.

Explain it another way

Two people guess where the crater is. One is usually within 3 m, the other within 2 m. You trust the better one more, but not completely, and combining them makes you more confident than either alone.

Derivation: Product of two Gaussians
  1. Prior ∝ exp(−(x − μ₀)²/(2σ₀²)); likelihood ∝ exp(−(z − x)²/(2σ²)).

  2. Posterior ∝ exp(−½[(x − μ₀)²/σ₀² + (x − z)²/σ²]). The exponent is quadratic in x, so the posterior is Gaussian.

  3. Collect x² terms: coefficient 1/σ₀² + 1/σ² = 1/σ₁². So 1/σ₁² = 1/σ₀² + 1/σ²: precisions add.

  4. Collect x terms: μ₁/σ₁² = μ₀/σ₀² + z/σ². So μ₁ = σ₁²(μ₀/σ₀² + z/σ²).

  5. Rewrite with K = σ₀²/(σ₀² + σ²): μ₁ = μ₀ + K(z − μ₀), σ₁² = (1 − K)σ₀². This is exactly the Kalman update.

Worked example 1

Prior N(100, 4²), measurement 106 with σ = 4. Posterior?

Equal precisions: K = 0.5. μ₁ = 103, σ₁² = 8, σ₁ ≈ 2.83 (σ/√2).

Common mix-ups

  • Combining a good and a bad estimate gives something in between in quality.
    ✓ The posterior is better than BOTH, provided the errors are independent and correctly modelled.
  • The posterior mean is the plain average.
    ✓ Only when the two variances are equal. Otherwise it leans towards the more precise source.

7.Practice on your own

Practice, not a test. Wrong answers get a hint and another try.

Practice 2 · a fresh version every time

Prior belief about a crater's distance: normal, mean 10 m, σ₀ = 6 m. A lidar measurement reads z = 6 m with σ = 1 m. What is the posterior mean, in metres?

m

Practice 3

If the measurement is far noisier than the prior (σ ≫ σ₀), the update…

Practice 4

Prior variance 6 m², measurement variance 2 m². What is K?

8.Apply it

A rover's prior on a landmark distance is N(15, 2²). Three independent lidar readings arrive: 16.1, 15.7, 16.4 m, each σ = 1 m. Update one at a time, then all at once using their mean (σ = 1/√3). Show both routes agree.

9.Reflect

Concepts: Bayesian estimation · Sensor fusion