- Introduced by
- Rudolf E. Kalman
- Year
- 1960
- Type
- Recursive optimal filter
- Family
- Optimal state estimation
What does it do?
The Kalman filter is a recursive algorithm that estimates the state of a linear dynamic system from noisy measurements.
Under linear dynamics and Gaussian noise, its estimates minimize the mean-square estimation error. Rudolf Kalman introduced the method in 1960 for linear filtering and prediction problems, and it is widely used for tracking and navigation.
The intuition behind the method
The core idea of the Kalman filter is to recursively update state estimates using a two-step process: prediction and measurement update. At each time step, the filter predicts the next state using a mathematical model, then corrects this prediction based on a new measurement. The filter automatically determines the optimal weighting between model prediction and measurement—trusting the model when measurements are noisy, and trusting the measurement when the model is uncertain. This recursive structure makes the Kalman filter computationally efficient for real-time processing.
History
Rudolf Kalman introduced the algorithm in his 1960 paper, which treats linear filtering and prediction with a state-transition method and applies to both stationary and nonstationary statistics. The filter is commonly described as extending Wiener's optimal filtering theory to dynamic systems. Its recursive formulation allowed estimates to be updated as each measurement arrived, rather than through batch computation. Later developments such as the EKF, UKF and particle filters addressed nonlinear systems.
When to use it
Choose the Kalman filter when the system dynamics are approximately linear, the noise is approximately Gaussian, and estimates are needed sequentially as measurements arrive. Typical cases are trajectory tracking, navigation, and smoothing a sensor signal when a dynamic model of the signal is available. It also suits multi-sensor setups in which each sensor contributes a measurement equation for the same state vector. Do not use the standard filter when the process or measurement model is strongly nonlinear; the Extended Kalman Filter (EKF) or Unscented Kalman Filter (UKF) is the usual alternative. It is also unsuitable for non-Gaussian or impulsive noise, where the mean-square optimality no longer applies in the same form, and when no reasonable model of the state dynamics can be stated, because the output depends directly on that model.
Limitations and considerations
- The optimality result requires linear dynamics and Gaussian noise; with nonlinear models the filter is an approximation and its error can grow substantially.
- The estimates depend on the process noise covariance Q and the measurement noise covariance R, and incorrect values shift the Kalman gain and therefore the estimate.
- If the assumed model differs from the true system, the filter can diverge: the estimate drifts from the true state while the computed covariance may remain small.
- Each step requires matrix products and a matrix inversion, which is more work than a simple moving average and requires an explicit model of the system.
- The basic formulation assumes white noise; correlated (colored) noise must be modeled by augmenting the state vector with a noise model.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Under linear dynamics and Gaussian noise, the recursive estimate has minimum mean-square error, which is the optimality property the filter is designed around.
- Each update uses only the previous estimate and its error covariance, so the full measurement history does not have to be stored.
- The error covariance is propagated alongside the estimate, giving a quantitative uncertainty measure at every step, as the covariance recursion in Kalman's 1960 paper describes.
- The model matrices may change from step to step, so changing dynamics or irregular sampling can be handled by updating the model at each update.
- Measurements from several sensors can be processed as additional measurement equations acting on the same state vector.
Applications
- Real-time position and velocity estimation in GPS and inertial navigation systems
- Tracking of moving targets in radar, sonar and computer vision
- State estimation in electrical power systems, including detection of faults in the grid
- Biomedical signal processing, such as artifact removal and tracking of physiological parameters from noisy sensors
- Smoothing of noisy sensor signals when a dynamic model of the signal is available
How it works
How it works
Define the state vector x_t of the quantities to be estimated, the state transition matrix F and the measurement matrix H that relates the state to the measurement z_t. The process noise w_t and measurement noise v_t are taken to be zero-mean, with covariances Q and R.
Set an initial state estimate x̂_init and an initial error covariance P_init, and specify the process noise covariance Q and the measurement noise covariance R.
Predict the next state and its error covariance: x̂_{t|t-1} = F x̂_{t-1|t-1} and P_{t|t-1} = F P_{t-1|t-1} F^T + Q.
Compute the innovation (measurement residual) z_t − H x̂_{t|t-1} and its covariance S_t = H P_{t|t-1} H^T + R. Then compute the Kalman gain K_t = P_{t|t-1} H^T S_t^{-1}, which sets the balance between prediction and measurement.
Update the estimate x̂_{t|t} = x̂_{t|t-1} + K_t (z_t − H x̂_{t|t-1}) and the covariance P_{t|t} = (I − K_t H) P_{t|t-1}, where I is the identity matrix. Repeat the predict and update steps for each subsequent measurement.
Common pitfalls
- Setting Q and R inconsistently with the real noise yields a suboptimal or unstable filter, so these values usually need to be checked against data.
- Applying the linear filter to a strongly nonlinear system without linearization or a nonlinear variant such as the EKF or UKF.
- Overlooking filter divergence: persistent structure in the innovation (measurement residual) sequence signals a mismatch between the model or noise statistics and the data.
- Treating theoretical noise values as final without comparing them with residual statistics from real measurements.
- Ignoring numerical issues: rounding can destroy the symmetry or positive definiteness of the covariance matrix, which matters in embedded implementations.
Frequently asked questions
What is the Kalman gain and how does it determine filtering behavior?
The Kalman gain sets how strongly the measurement residual corrects the model prediction. When the predicted error covariance is large relative to the measurement noise, the gain is large and the filter relies more on the measurement. When measurement noise dominates, the gain is small and the model prediction is trusted more. In the matrix case the gain is computed from the predicted error covariance, the measurement matrix and the measurement noise covariance, and it is recomputed at each step.
How do I choose process and measurement noise covariances?
In principle, Q (process noise covariance) and R (measurement noise covariance) should reflect the true noise statistics. In practice they are often estimated from data: R can be estimated from measurements taken when the true signal is known to be constant, and Q from how far model predictions deviate from observed behavior. Because such estimates are rough, tuning is common. Monitoring the innovation sequence helps check whether the chosen values are consistent with the data.
What is the difference between the Kalman filter and the Wiener filter?
Both produce linear minimum mean-square error estimates, but they address different settings. The Wiener filter is designed for stationary signals and yields a fixed set of coefficients from a batch computation. The Kalman filter handles time-varying systems and updates its estimate recursively as each measurement arrives. It also uses an explicit process model of how the state evolves.
When should I use the Extended Kalman Filter (EKF) instead of the standard Kalman filter?
Use the EKF when the system is nonlinear in the process model, the measurement model, or both. The EKF linearizes the nonlinear functions around the current state estimate and applies the standard Kalman equations to the linearized system. This approximation works reasonably when the nonlinearity is mild. For strongly nonlinear systems, the Unscented Kalman Filter (UKF) or particle filters may be preferable, at higher computational cost.
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 referenceGrewal, M. S., & Andrews, A. P. (2015). Kalman Filtering: Theory and Practice with MATLAB (4th ed.). Wiley-IEEE Press.
Open publication reference