Library
Mathematics

The Intuition Behind the Kalman Filter

This lesson demystifies the Kalman Filter, a recursive algorithm that fuses uncertain measurements with a mathematical model of a system to produce an optimal estimate of a hidden state.

Scene 1 of 4
The Problem of Uncertainty
State=Model+Noise\text{State} = \text{Model} + \text{Noise}
Imagine you are tracking a drone in the sky. You have two sources of information: a physical model of how it moves, which is prone to wind gusts, and a GPS sensor, which is prone to signal noise. Neither is perfect on its own.
Step-by-step solver
1

Prediction Step

Calculate the next state estimate and the associated uncertainty based on the previous state and physical laws.

xˉt=Fxt1,Pˉt=FPt1FT+Q\bar{x}_t = Fx_{t-1}, \quad \bar{P}_t = FP_{t-1}F^T + Q
2

Innovation/Gain Calculation

Determine the Kalman Gain by comparing the uncertainty of the prediction to the uncertainty of the measurement sensor.

Kt=PˉtHT(HPˉtHT+R)1K_t = \bar{P}_t H^T (H \bar{P}_t H^T + R)^{-1}
3

Update Step

Refine the prediction using the incoming measurement and the Kalman Gain.

xt=xˉt+Kt(ztHxˉt)x_t = \bar{x}_t + K_t(z_t - H\bar{x}_t)

Original question

explain to me how a kalman filter works

Follow-up chat

Ask me anything about this lesson — I'll answer using what we just covered.