Chapter 76: the Kalman filter

Kalman Filter A Bayes filter with Gaussians: readings make the bell narrower, moving makes it wider

Chapters 72 to 75 gave the robot several sensors and their noise. The Kalman filter is the algorithm that fuses their data and filters the noise. This page follows a robot on a straight road: a first guess, a rock detector that sharpens it, a move that blurs it again, and the loop that repeats these steps.

Words used on this page (open this if a word is new)
Kalman filterA Bayes filter that assumes Gaussian noise for the motion and the sensor.
Bayes filterAn algorithm that updates a belief with Bayes rule when new evidence arrives.
prior beliefThe estimate of the position before a new reading or move.
measurement updateThe estimate of the position from a sensor reading, a Gaussian.
posteriorThe new belief after combining two pieces of information.
state predictionPredicting the next position after the robot moved.
μ and σThe centre (best guess) and the spread (uncertainty) of a Gaussian, here in metres.
01

Bayes filters and the measurement update

The Kalman filter is a Bayes filter that uses Gaussians. A sensor reading turns the prior belief into a narrower posterior. Use Next and Back, the sliders and the buttons. Point at a coloured word to light up its part of the picture.

Key idea. The Kalman filter is a Bayes filter that assumes Gaussian motion and sensor noise. Combining the prior belief with the measurement update gives a posterior with a smaller σ than both.

Quick check

02

Motion update and the Kalman loop

Moving the robot makes the belief wider. The filter repeats measurement update and state prediction in a loop. Use Next and Back, the sliders and the buttons. Point at a coloured word to light up its part of the picture.

Key idea. In the state prediction the motion adds its own error, so the σ grows. The Kalman filter loops: initial estimate, measurement update, state prediction, and again.

Quick check

03

Summary and quiz

Key takeaways

  1. The Kalman filter fuses sensor data and filters noise. It is a Bayes filter that assumes Gaussian noise.
  2. The prior belief is a first, uncertain estimate of the position.
  3. A sensor reading gives the measurement update; combining it with the prior gives a posterior narrower than both.
  4. The posterior becomes the prior of the next step.
  5. Moving the robot (state prediction) adds the motion error, so the posterior gets wider.
  6. The loop: initial estimate, measurement update, state prediction, again and again.

Quiz