Library
Mathematics

The Kalman Filter: Tracking with Uncertainty

An exploration of the Kalman filter, demystifying how we track moving objects using imperfect, noisy data by balancing predictions with observations.

The Tracking ProblemTimePosition
xtrue=xguess+noisex_{true} = x_{guess} + noise
Imagine you are tracking a mail truck. You only get occasional, noisy GPS signals, and the truck might hit traffic or turn unexpectedly. How do you find the true path when every piece of information you have is flawed?
Step-by-step solver
1

(a) Setup

Identify the goal: calculate a state estimate by combining a physics-based prediction with sensor observations.

x^k=x^k−+Kk(zk−Hx^k−)\hat{x}_k = \hat{x}_k^{-} + K_k(z_k - H\hat{x}_k^{-})
2

(b) Prediction

Use the transition model and control inputs to estimate the next state and update the error covariance.

x^k−=Ax^k−1+Buk,Pk−=APk−1AT+Q\hat{x}_k^{-} = A\hat{x}_{k-1} + Bu_k, \quad P_k^{-} = AP_{k-1}A^{T} + Q
3

(c) Update

Calculate the Kalman Gain, update the state estimate based on the innovation, and adjust the uncertainty covariance.

Kk=Pk−HT(HPk−HT+R)−1,Pk=(I−KkH)Pk−K_k = P_k^{-}H^{T}(HP_k^{-}H^{T} + R)^{-1}, \quad P_k = (I - K_kH)P_k^{-}

Original question

Explain to me how mailman filter works

Follow-up chat

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