- Introduced by
- Rudolf E. Kalman
- Year
- 1960
- Type
- recursive Bayesian filter
- Family
- Bayesian / computational
What does it do?
The Kalman filter is an optimal recursive algorithm for estimating the hidden state of a linear dynamical system from noisy measurements.
At each time step it alternates between a prediction step, which projects the state forward using the system model, and an update step, which corrects the prediction with the new observation. Under linear-Gaussian assumptions it produces state estimates that are minimum-mean-squared-error, together with their uncertainty, in real time.
The intuition behind the method
Imagine tracking a moving object with a radar that makes noisy measurements. The Kalman filter keeps a running belief about the object's true position and velocity as a Gaussian distribution. At each tick it first predicts where the object should be based on the system model, then blends that prediction with the radar reading. How much it trusts the radar versus the prediction is set by the Kalman gain, which depends on the relative sizes of process noise and measurement noise. Under the linear-Gaussian assumptions, the result is the minimum mean-squared-error linear estimate of the state at every step.
History
Rudolf E. Kalman's 1960 paper, published in the Journal of Basic Engineering, gave a recursive solution to linear filtering and prediction problems. It derived a nonlinear difference equation for the optimal error covariance, from which the coefficients of the optimal linear filter follow, and it showed the filtering problem to be the dual of the noise-free regulator problem. A continuous-time version of the filter also exists and is sometimes called the Kalman-Bucy filter. Later variants such as the extended (EKF), unscented (UKF) and ensemble filters were developed for nonlinear and high-dimensional settings.
When to use it
Use the Kalman filter when your system is linear, noise is Gaussian, and you need real-time or recursive state estimation from sequential measurements. Classic examples include sensor fusion, navigation (GPS/IMU), target tracking, and econometric state-space models. Under these assumptions it is the minimum-MSE linear filter, and it runs in closed form with no sampling. Do not use it when the system dynamics or observation model are nonlinear (use the Extended or Unscented Kalman filter, or a particle filter instead), when noise distributions are heavy-tailed or multimodal, or when the state-space dimension is so large that matrix inversions become prohibitive.
Limitations and considerations
- The state-transition and observation models must be linear (F and H); any nonlinearity in the true dynamics has to be approximated, or the filter replaced by an EKF or UKF.
- Optimality requires Gaussian, zero-mean, mutually independent noise in w and v; heavy-tailed or multimodal noise removes that guarantee.
- Q and R are inputs rather than outputs: the gain K, and therefore every estimate, depends directly on their assumed values, which are often unknown.
- If the assumed model differs from the real system, the filter can drift or diverge, and the reported covariance P then understates the actual error.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Recursive: each step uses only the previous estimate and covariance together with the new measurement, so past observations do not need to be stored.
- For linear estimators with the stated noise second moments, it gives the minimum mean-squared-error estimate. Under Gaussian noise and initial state, it is the overall conditional-mean (minimum-MSE) estimate.
- The covariance matrix P gives an uncertainty measure for every state estimate, alongside the point estimate.
- A missing measurement is handled by running only the prediction step, in which case the covariance grows without an update.
- The theory is long established and the equations are short enough to implement and inspect line by line.
Applications
- Inertial navigation and GPS/IMU sensor fusion in aircraft, ships, and autonomous vehicles.
- Object and target tracking in radar, sonar, and computer vision systems.
- State-space econometric models for estimating latent variables such as trend and seasonality in time series.
- Signal processing and noise reduction in audio, communications, and biomedical signals (e.g., ECG filtering).
- Robotics localization and simultaneous localization and mapping (SLAM).
- State-space models with time-varying coefficients, such as time-varying betas or volatility in financial time series.
How it works
How it works
The system is described by two linear equations. The state equation propagates the hidden state x through transition matrix F, with an optional control input u acting through B, and additive Gaussian process noise w ~ N(0,Q). The observation equation maps the true state to a noisy measurement y via observation matrix H and measurement noise v ~ N(0,R). Both noise terms are assumed zero-mean Gaussian and mutually independent.
Formula
x_t = F x_{t-1} + B u_t + w_t, \quad y_t = H x_t + v_tIn the prediction step the prior mean of the state is propagated one step forward using F and the known input term B u_t, and the prior covariance P is inflated by the process noise covariance Q. This gives the predicted state estimate and its uncertainty before the new measurement is seen. When the system has no known input, the B u_t term is zero and the formula reduces to the standard form. The recursion requires an initial state and covariance, described in the in-practice section.
Formula
\hat{x}_{t|t-1} = F \hat{x}_{t-1|t-1} + B u_t, \quad P_{t|t-1} = F P_{t-1|t-1} F^\top + QThe Kalman gain K balances trust in the prediction against trust in the measurement. It is large (the observation is trusted more) when measurement noise R is small relative to prediction uncertainty, and small (the model is trusted more) when R is large. Computing K requires inverting the innovation covariance S = H P H' + R.
Formula
K_t = P_{t|t-1} H^\top (H P_{t|t-1} H^\top + R)^{-1}The update step corrects the predicted estimate by adding a fraction of the innovation, the difference between the actual measurement and the predicted measurement. The Kalman gain determines that fraction, yielding the posterior mean of the state conditioned on all observations up to time t.
Formula
\hat{x}_{t|t} = \hat{x}_{t|t-1} + K_t (y_t - H \hat{x}_{t|t-1})The posterior covariance P is reduced from the predicted covariance by the information contributed by the new measurement. This posterior covariance then becomes the prior for the next prediction step, completing the recursive cycle.
Formula
P_{t|t} = (I - K_t H) P_{t|t-1}Common pitfalls
- Treating Q and R as fixed when they should be estimated or adapted from data.
- Applying the standard Kalman filter directly to nonlinear systems without linearization or an Extended/Unscented variant.
- Ignoring numerical issues: the covariance matrix P can lose positive-definiteness due to floating-point errors. The Joseph form or a square-root Kalman filter improves numerical stability.
- Forgetting that optimality holds only when the assumed noise statistics match the true noise; validate with normalized innovation squared (NIS) tests.
- Confusing the filter's posterior covariance with the actual error. If the model is misspecified, P will underestimate the true uncertainty.
- Dropping the control term B u_t from the prediction when the system has a known input. The prediction must include B u_t, as the state equation specifies.
Frequently asked questions
What is the difference between the Kalman filter and a particle filter?
The Kalman filter is exact and closed-form but restricted to linear-Gaussian systems. A particle filter (sequential Monte Carlo) uses a cloud of weighted samples to represent the posterior and can handle nonlinear, non-Gaussian models, at the cost of much greater computation and variance.
How do I choose Q and R?
R (measurement noise) is often available from sensor specifications or calibration data. Q (process noise) is harder: start from physical reasoning about unmodeled disturbances, then refine using normalized innovation squared (NIS) tests or expectation-maximization (EM) to estimate Q from data. As a consistency check, if the time-averaged NIS falls well outside the chi-square bounds for the measurement dimension, the assumed Q or R is probably mis-specified and the noise covariances should be re-estimated.
What is the Extended Kalman Filter (EKF)?
The EKF linearizes nonlinear state and observation functions around the current state estimate using a first-order Taylor expansion, then applies the standard Kalman update. It is widely used in robotics and navigation but can diverge when nonlinearity is strong. The Unscented Kalman Filter (UKF) instead propagates a deterministic set of sigma points through the nonlinear functions and avoids the explicit linearization step.
Is the Kalman filter Bayesian?
Yes. It is the exact solution to recursive Bayesian filtering for linear-Gaussian systems. The prediction step computes the Chapman-Kolmogorov prior, and the update step applies Bayes' rule; because both prior and likelihood are Gaussian, the posterior is also Gaussian and is computed exactly.
Can the Kalman filter handle missing observations?
Yes. When a measurement is missing at time t, skip the update step and carry the predicted distribution forward as the posterior. This is one of the practical advantages of the recursive Bayesian framework.
Related methods
Sources
Kalman, R. E. (1960). A new approach to linear filtering and prediction problems. Journal of Basic Engineering, 82(1), 35-45.
Open DOI referenceWelch, G. & Bishop, G. (2006). An Introduction to the Kalman Filter. University of North Carolina at Chapel Hill, Technical Report TR 95-041.
Open publication reference