- Introduced by
- Rudolf E. Kalman
- Year
- 1960
- Type
- Recursive Bayesian state-space estimator
- Family
- Bayesian / computational
What does it do?
The Kalman filter with measurement error is the standard linear Gaussian state-space filter, with the observation noise covariance R specified explicitly alongside the process noise covariance Q. It estimates a hidden state of a dynamic system from noisy observations by alternating a prediction step, which propagates the state and its uncertainty forward through the dynamics, with an update step that corrects the prediction using each new measurement.
The emphasis of this page is on deliberate specification of R and Q, since the recursion itself is the ordinary Kalman filter.
The intuition behind the method
Imagine tracking a moving object with a sensor that is not perfectly accurate. A motion model gives a rough prediction of where the object should be next, but the sensor reading is also uncertain. The Kalman filter quantifies both sources of uncertainty and blends the prediction with the reading: when the sensor is very noisy, it leans on the model; when the model is uncertain, it trusts the data more. The measurement error covariance R is the key input that encodes how much noise contaminates each observation, so the filter down-weights unreliable readings through the gain rather than through a separate rule.
History
Kalman introduced the recursive filter in his 1960 paper, which treats filtering and prediction with a state-transition method and derives a nonlinear difference equation for the covariance of the optimal estimation error; the coefficients of the optimal linear filter follow from its solution. The paper also presents the filtering problem as the dual of the noise-free regulator problem. The separate observation covariance used on this page is the standard form of the filter.
When to use it
Use this filter when you have time-ordered observations of a quantity that depends on a latent state you cannot observe directly, when the transition and observation equations are approximately linear, when the noise is plausibly Gaussian, and when you can state a defensible R (and Q) from instrument information or estimation. Typical examples are tracking, navigation, signal extraction, and estimating an unobserved trend from noisy macroeconomic series. Do not use it when the transition or observation model is strongly nonlinear (consider the extended or unscented Kalman filter, or a particle filter), when the noise is heavy-tailed, skewed or multimodal, or when R cannot be specified on any defensible basis, because the filtered output then mostly reflects the assumed R.
Limitations and considerations
- Assumes linear transition and observation equations with fixed F and H; the optimality result does not hold when these are nonlinear.
- The linear minimum-MSE property of the recursion relies on the stated noise moments (zero-mean, uncorrelated noise with covariances Q and R). Gaussian noise is additionally needed for the filter to be the overall minimum-MSE estimator among all estimators and for the covariance to describe the full posterior. Heavy-tailed, skewed or multimodal errors, including occasional outlier readings, therefore weaken these properties and can make the estimates sensitive to a few observations.
- The gain and the reported covariances depend on the assumed Q and R; if they are misspecified, the recursion still runs but the state uncertainty is wrong.
- Numerical problems can arise when covariance matrices are poorly conditioned, and the model must be identifiable from the data for the estimates of Q and R to be meaningful.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Under linear Gaussian assumptions it gives the minimum mean squared error linear estimate of the state, and the Gaussian posterior it propagates is exact rather than approximate.
- R and Q enter as separate matrices, so the contribution of instrument noise and of dynamic variation to the uncertainty can be examined separately.
- Each step uses matrix operations on the current mean and covariance rather than reprocessing earlier observations, which keeps long series practical; the cost per step depends on the state and observation dimensions.
- The Kalman gain sets the weight on each new observation from the current covariances, so a noisier instrument is down-weighted without a separate rule.
- Provides filtered means and covariances at every time step, supporting statements about the uncertainty of the state.
- Extends to the Kalman smoother (see FAQ), which uses all observations for retrospective state estimates.
Applications
- Navigation and positioning systems that fuse noisy inertial measurements with satellite signals.
- Econometric extraction of latent trends from noisy macroeconomic indicators, such as potential output or inflation expectations.
- Signal processing for filtering sensor data in robotics, autonomous vehicles, and aerospace.
- Estimating unobserved psychological or biomedical states from repeatedly measured but error-prone indicators.
- Financial time series: extracting an underlying price or volatility from tick-by-tick data contaminated by bid-ask bounce.
- Environmental monitoring: tracking true pollution levels from imprecise sensor arrays.
How it works
How it works
The state equation describes how the latent state x_t evolves from the previous state through the transition matrix F, with process noise w_t drawn from a zero-mean Gaussian with covariance Q. Q represents variation in the underlying process itself, not error in the measurements.
Formula
x_t = F x_{t-1} + w_t, \quad w_t \sim \mathcal{N}(0, Q)The observation equation maps the state into the measured quantities through H and adds measurement error v_t, a zero-mean Gaussian with covariance R. R encodes how noisy each observed variable is; it is typically set from instrument information or estimated jointly with Q.
Formula
y_t = H x_t + v_t, \quad v_t \sim \mathcal{N}(0, R)Before the new observation arrives, the filter propagates the previous posterior mean through F and the covariance through F P F-transpose plus Q. Process noise adds to the predicted covariance, so uncertainty grows between observations.
Formula
\hat{x}_{t|t-1} = F\hat{x}_{t-1|t-1}, \quad P_{t|t-1} = F P_{t-1|t-1} F^\top + QThe Kalman gain K_t is built from the predicted covariance and R. The matrix (H P H-transpose plus R) that is inverted is the covariance of the innovation, the difference between the observed value and the predicted observation. A large R increases this matrix and shrinks K_t, so the update leans on the prediction; a small R reduces it and enlarges K_t, so the observation carries more weight. Under the linear Gaussian assumptions this gain gives the optimal linear weighting.
Formula
K_t = P_{t|t-1} H^\top (H P_{t|t-1} H^\top + R)^{-1}The posterior mean adds K_t times the innovation, the gap between the observed value and the predicted observation H x_pred. The posterior covariance (I - K_t H) P_pred is smaller than the predicted covariance, reflecting the information in the new observation. The cycle repeats at every time step.
Formula
\hat{x}_{t|t} = \hat{x}_{t|t-1} + K_t(y_t - H\hat{x}_{t|t-1}), \quad P_{t|t} = (I - K_t H)P_{t|t-1}Common pitfalls
- Setting R at or near zero, which makes the gain put almost all weight on the observation and ignores the model prediction.
- Holding Q and R fixed at guessed values when they could be estimated from the prediction-error likelihood or constrained by calibration data.
- Ignoring the initial mean and covariance P0; with a diffuse or poorly chosen P0, early estimates reflect the starting values rather than the data.
- Applying the linear filter to a nonlinear system without linearisation or switching to a nonlinear variant.
- Skipping innovation diagnostics: innovations that are serially correlated or have non-zero mean indicate that the assumed model or noise levels do not match the data.
Frequently asked questions
What is the measurement error covariance R and how do I choose it?
R is a matrix (diagonal when measurement errors are independent) encoding the variance of the observation noise for each measured variable. In practice, R can be derived from instrument calibration data, estimated jointly with Q by maximising the log-likelihood of the observations (using the prediction-error decomposition), or specified from domain knowledge. Sensitivity analysis over plausible R values is strongly recommended.
What is the difference between process noise Q and measurement error R?
Q captures uncertainty in the system dynamics, that is, how unpredictably the true state changes between steps. R captures uncertainty in the sensor or instrument, that is, how much noise contaminates each reading. A large Q means the state moves erratically; a large R means the measurements are imprecise. Both affect the Kalman gain and therefore how much weight the filter assigns to new observations.
When should I use a particle filter instead?
Use a particle filter when the state transition or observation equation is nonlinear and non-Gaussian, and a linearisation (as in the extended Kalman filter) is inadequate. Particle filters are more flexible but computationally much heavier. For mildly nonlinear systems the unscented Kalman filter (UKF) is often a practical middle ground.
Can I estimate R from the data rather than fixing it?
Yes. The prediction-error decomposition of the Kalman filter yields the log-likelihood of the observations as a function of Q and R. Maximising this likelihood, or using Bayesian priors in a full Bayesian state-space framework, gives data-driven estimates of both covariance matrices. This is preferable to ad-hoc specification when calibration information is unavailable, although the estimates are only as good as the model is correct.
What is the Kalman smoother and when do I need it?
The Kalman filter is a forward-pass algorithm that estimates the state using only past and current observations. The smoother (Rauch-Tung-Striebel) runs a backward pass and produces retrospective estimates using all observations, which generally have lower uncertainty. Use the smoother when you need the best possible state estimates for historical analysis rather than real-time tracking.
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 referenceDurbin, J. & Koopman, S. J. (2012). Time Series Analysis by State Space Methods (2nd ed.). Oxford University Press.
ISBN: 978-0199641178