Kalman Filter
The Kalman filter is a recursive linear-quadratic state-space estimation algorithm that infers the hidden state of a dynamical system from sequential noisy measurements by minimizing the posterior mean-squared estimation error.
The Kalman filter (also known in control theory as LinearโQuadratic Estimation, or LQE) is a recursive mathematical algorithm in computation and algorithms that estimates the internal state vector of a time-evolving dynamical system from a time series of indirect, noise-corrupted measurements. Published in discrete-time form by Hungarian-American electrical engineer Rudolf E. Kรกlmรกn in 1960โand extended to continuous-time differential systems by Kรกlmรกn and Richard S. Bucy in 1961, building on earlier statistical foundations by Thorvald Nicolai Thiele (1880) and Peter Swerling (1958)โthe filter operates in a two-phase predictโupdate cycle. Unlike Wiener filtering, which requires storing the entire historical observation record, the Kalman filter summarizes all past history within a sufficient statistic consisting of the current state estimate xฬk|k and its n ร n error covariance matrix Pk|k. When process disturbances and sensor errors follow Gaussian distributions, the Kalman filter implements recursive Bayesian Inference in closed form; when noise distributions are non-Gaussian with finite second moments, it remains the Best Linear Unbiased Estimator (BLUE).
Linear State-Space Model and Noise Assumptions
State-Transition and Observation Equations
Consider a discrete-time linear dynamical system whose hidden state at time step k โ N is represented by xk โ Rn. The state transition from step k โ 1 to k and the generation of an m-dimensional sensor measurement zk โ Rm follow the coupled linear stochastic difference equations:
- State-Transition Equation: xk = Fk xkโ1 + Bk uk + wk
- Observation Equation: zk = Hk xk + vk
where Fk โ Rnรn is the state-transition matrix, Bk โ Rnรl is the control-input matrix acting on deterministic control vector uk โ Rl, and Hk โ Rmรn is the observation matrix. The vectors wk โผ N(0, Qk) and vk โผ N(0, Rk) represent mutually independent, zero-mean white Gaussian process noise (covariance Qk โฅ 0) and measurement noise (covariance Rk > 0).
Recursive Predict-and-Update Cycle
Phase 1: A Priori Time Update (Prediction)
Given the previous posterior state estimate xฬkโ1|kโ1 and error covariance Pkโ1|kโ1 = E[(xkโ1 โ xฬkโ1|kโ1)(xkโ1 โ xฬkโ1|kโ1)T], the filter projects the state and uncertainty forward across timestep k:
- Prior State Estimate: xฬk|kโ1 = Fk xฬkโ1|kโ1 + Bk uk
- Prior Error Covariance: Pk|kโ1 = Fk Pkโ1|kโ1 FkT + Qk
Phase 2: A Posteriori Measurement Update (Correction)
When measurement zk arrives, the filter compares it against the predicted observation Hkxฬk|kโ1 to form the innovation (measurement residual) แปนk and its covariance Sk:
- Innovation Vector: แปนk = zk โ Hk xฬk|kโ1, with Sk = Hk Pk|kโ1 HkT + Rk
- Optimal Kalman Gain: Kk = Pk|kโ1 HkT Skโ1
- Posterior State & Covariance: xฬk|k = xฬk|kโ1 + Kk แปนk, and Pk|k = (I โ Kk Hk) Pk|kโ1
Optimal Gain Derivation and Joseph Stabilized Form
For any gain matrix Kk, expanding the covariance of the posterior error ek = (I โ KkHk)(xk โ xฬk|kโ1) โ Kkvk yields the symmetric Joseph stabilized covariance form:
Pk|k = (I โ Kk Hk) Pk|kโ1 (I โ Kk Hk)T + Kk Rk KkT
Differentiating the mean-squared error E[โekโ22] = Tr(Pk|k) with respect to Kk and setting โTr(Pk|k)/โKk = โ2(HkPk|kโ1)T + 2KkSk = 0 yields Kk = Pk|kโ1HkTSkโ1. When sensor noise is large (Rk โ โ), Kk โ 0 and the filter trusts its dynamical prediction; when prior uncertainty dominates (Rk โ 0), Kk โ Hkโ1 and the filter trusts the sensor measurement. To prevent floating-point loss of positive-definiteness, spacecraft navigation software uses the Joseph form or Potter's square-root filter, which propagates the Cholesky Decomposition factor P = LLT.
Nonlinear Extensions and Scientific Applications
Extended, Unscented, and Ensemble Kalman Filters
Physical systems in orbital mechanics, robotics, and geophysical fluid dynamics follow nonlinear state transitions xk = f(xkโ1, uk) + wk and observation mappings zk = h(xk) + vk:
| Filter Variant | Nonlinearity Handling | State Scaling | Primary Scientific & Engineering Applications |
|---|---|---|---|
| Linear Kalman Filter (KF) | Linear matrices Fk, Hk | O(n3) | Radar tracking, inertial navigation, state-space econometrics |
| Extended Kalman Filter (EKF) | 1st-order Taylor Jacobians F = โf/โx, H = โh/โx | O(n3) | Apollo cislunar navigation, GPS/INS fusion, SLAM |
| Unscented Kalman Filter (UKF) | Deterministic Unscented Transform (2n + 1 sigma points) | O(n3) | High-angle attitude control, nonlinear chemical reactors |
| Ensemble Kalman Filter (EnKF) | Monte Carlo ensemble of Nens โ 50โ100 realizations | O(Nens2 n) | Numerical weather prediction, General Circulation Model assimilation |
Apollo Navigation and Geophysical Data Assimilation
The first operational deployment of the Kalman filter occurred at NASA's Ames Research Center under Stanley F. Schmidt in 1960โ1961 for the Apollo Guidance Computer (AGC), fusing onboard sextant star-landmark angles with ground radar along the nonlinear EarthโMoon trajectory via the Extended Kalman Filter (EKF). In contemporary atmospheric and ocean sciences, Geir Evensen's Ensemble Kalman Filter (EnKF) (1994) assimilates millions of satellite radiance and ocean float observations into global forecast models with n > 108 state variables.
Frequently Asked Questions
Why is the Kalman filter called a recursive estimator?
Because the prior estimate xฬk|kโ1 and covariance Pk|kโ1 form a sufficient statistic for all past measurements z1:kโ1, raw historical observations can be discarded after each update, keeping memory and CPU cost constant per timestep.
How does the Unscented Kalman Filter (UKF) improve upon the Extended Kalman Filter (EKF)?
The EKF linearizes f(x) via first-order Taylor Jacobians at the mean, which can underestimate covariance and diverge under strong curvature. The UKF (Julier and Uhlmann, 1997) propagates 2n + 1 deterministic sigma points through the true nonlinear function f, capturing the posterior mean and covariance to third order without Jacobians.
What is the difference between Kalman filtering and Kalman smoothing?
Filtering estimates the current state xk given measurements up to the present (z1:k), whereas smoothing (such as the RauchโTungโStriebel smoother) runs a backward pass over a recorded trajectory z1:T to estimate xฬk|T using both past and future observations.
References
- Kรกlmรกn, R. E. (1960). A new approach to linear filtering and prediction problems. Journal of Basic Engineering, 82(1), 35โ45. https://doi.org/10.1115/1.3662552
- Kรกlmรกn, R. E., & Bucy, R. S. (1961). New results in linear filtering and prediction theory. Journal of Basic Engineering, 83(1), 95โ108. https://doi.org/10.1115/1.3658902
- Rauch, H. E., Tung, F., & Striebel, C. T. (1965). Maximum likelihood estimates of linear dynamic systems. AIAA Journal, 3(8), 1445โ1450. https://doi.org/10.2514/3.3166
- Evensen, G. (1994). Sequential data assimilation with a nonlinear quasi-geostrophic model using Monte Carlo methods to forecast error statistics. Journal of Geophysical Research: Oceans, 99(C5), 10143โ10162. https://doi.org/10.1029/94JC00572
- Julier, S. J., & Uhlmann, J. K. (2004). Unscented filtering and nonlinear estimation. Proceedings of the IEEE, 92(3), 401โ422. https://doi.org/10.1109/JPROC.2003.823141