← Writing

22 August 2026 / Robotics, State Estimation

Kalman Filters

What happens to the Bayes filter when we assume everything is Gaussian

Steps

A Kalman filter moves through the same two steps every cycle, and the whole thing is easier to follow if we keep the chain in mind before any of the notation arrives:

As discussed in the discrete filter writeup, the action we take depends entirely on whether we are predicting or updating, and a Kalman filter is one specific choice about how to represent the belief while doing so.

Gaussians

The key idea is that a Kalman filter models the state as a Gaussian distribution, which means that representing a state requires only two things: an expected value and a variance. That is a strong assumption, but it buys us an enormous amount, because a distribution that would otherwise need an unbounded number of samples collapses into a handful of numbers we can carry forward cheaply.

Because the variables in a Kalman filter state depend on one another, a single variance per variable is not enough and we use a covariance matrix instead. It holds the variance of each variable along the diagonal and the covariance of every pair of variables in the off-diagonal entries:

The off-diagonal terms are what let the filter learn that two quantities move together, so that correcting one of them also drags the other in the right direction.

Trust

Recalling that a discrete filter is essentially a way of blending our prediction with the measurement we just received, the question of which one we trust more is answered entirely by the covariances. The filter is not making a judgement call, it is weighing two distributions against each other and landing wherever the arithmetic puts it.

If the measurement covariance is large, meaning the sensor is telling us it could be a long way off, then the filter leans on the prediction instead. If the process covariance is large, because our model of the physics is rough, then the filter leans on the measurement. Everything the filter does about trust is encoded in those two matrices, which is also why an untuned filter behaves badly even when the equations are correct.

Notation

Before the equations, the symbols. Every one of them is either something we estimate, something we model, or something we measure:

SymbolNameWhat it is
statewhat we are trying to estimate, such as position and velocity
state covariancehow uncertain we currently are, and how the variables correlate
process matrixhow the state evolves on its own over one timestep
process covariancehow much we distrust that model of the physics
, control matrix and inputwhat we commanded, and how it enters the state
measurement matrixhow a state would appear to the sensor
measurement covariancehow much we distrust the sensor
Kalman gainhow far to move toward the measurement, computed each step

Predict

The prediction step pushes the state forward through the process model and adds whatever we commanded, which gives us the prior:

At the same time the covariance has to grow, because a step taken on a model we do not fully trust leaves us less certain than we were before:

That second equation is the one people skip, and skipping it is how a filter ends up convinced it knows exactly where something is while quietly coasting on physics alone.

Update

The update step compares what the sensor reported against what our prior says the sensor should have reported, and the difference between those two is the innovation, .

How much of that difference we act on is the Kalman gain, which is where the two sets of covariances finally meet:

Then we move the estimate along the innovation by that amount and shrink the covariance, because we have just learned something and should be more certain than we were a moment ago:

Everything above assumes and are matrices that do not depend on the state. When that stops being true, as it does the moment a rotation by heading enters the observation model, we need the extended version instead, which is what the localizer redesign is about.

Discrete filtersBall filter in practice