Kalman Filter
Wikipedia · Kalman filter · CC BY-SA 4.0
The Kalman filter estimates the state of a linear system from noisy measurements. Each step has two phases: predict (use the model to forecast the next state) and update (correct the forecast using the measurement). It is optimal in the least-squares sense for Gaussian noise.
Prediction and update
Predict: propagate the state estimate forward using the system model. The uncertainty grows. Update: incorporate the new measurement. The Kalman gain weights how much to trust the measurement versus the prediction. If the measurement is precise (low noise), the gain is high and you trust the sensor. If the model is precise (low process noise), the gain is low and you trust the prediction.
The Kalman gain
K = P_predicted * H' * (H * P_predicted * H' + R)^(-1). Here P is the error covariance, H is the measurement matrix, and R is the measurement noise covariance. When R is large (noisy sensor), K is small and the filter mostly trusts the model. When P is large (uncertain model), K is large and the filter mostly trusts the measurement. Over time, P shrinks and the estimate converges.
Neighbors
- 📊 OpenIntro Ch. 5 — Inference — the Kalman update is Bayesian inference with Gaussian priors
- 🎰 Grinstead Ch. 6 — Expected Value — the Kalman filter minimizes expected squared error
- 🎰 Probability Ch.4 — the Kalman filter is Bayesian updating for Gaussian models
- 📐 Linear Algebra Ch.5 — eigenvalues of the covariance matrix determine filter gain
- 🤖 ML Ch.7 — Gaussian processes are infinite-dimensional Kalman filters