AI Glossary / Time series and signal processing / Intermediate
Kalman filter
Definition
A Kalman filter is a recursive method for estimating a hidden state in a linear dynamic system from noisy observations. It alternates a model-based prediction with a measurement-based correction, tracking both a state estimate and its uncertainty. With a correctly specified linear Gaussian model and suitable initial conditions, it computes the exact conditional state mean and covariance.
What it means
Sensors provide imperfect observations, and the system can change between readings. A Kalman filter combines what the model predicts with what the latest measurement suggests. The relative influence of each depends on their modeled uncertainty, rather than a fixed rule that always trusts one source more.
The state can include quantities not directly measured, such as velocity alongside position. Estimating them successfully requires that the dynamics and observations supply enough information; naming a variable in the state vector does not make it observable.
How it works
In prediction, propagate the previous estimate through the linear transition model and known controls. Propagate its covariance and add process-noise covariance, representing uncertainty in the evolution. In correction, compare the actual measurement with the predicted measurement to form the innovation.
Compute the Kalman gain from predicted state uncertainty, the observation model, and measurement-noise uncertainty. Use it to update the mean and covariance. The equations can operate sequentially without refitting to the complete history at every step. Gaussian assumptions justify the full Gaussian posterior interpretation; under other suitable conditions, related optimality claims are limited to linear estimation rather than arbitrary nonlinear estimators.
Three practical examples
- A tracking system combines motion predictions with noisy position readings to estimate position and velocity over time.
- A manufacturing application estimates an internal process variable from an indirect sensor and a linearized operating model, checking whether that approximation remains adequate.
- A forecasting system uses a linear state-space representation to update a latent level or trend as new observations arrive.
Think of it this way
Think of combining two maps with different reliability. A recent but noisy position report and a prediction based on previous movement both contain information. The Kalman filter adjusts their influence according to modeled uncertainty. Unlike simply averaging the maps, it also accounts for how the system changes and how measurements relate to the hidden state.
Worked example
Consider an original scalar random-walk model. After the previous observation, the estimated state is 10 with variance 4. The next state equals the previous state plus independent zero-mean process noise of variance 1, with no drift. Thus the predicted mean remains 10 and predicted variance becomes 4 + 1 = 5.
A direct sensor then reports 14. Its independent zero-mean measurement noise has variance 3. The innovation is 14 − 10 = 4, and innovation variance is 5 + 3 = 8. The Kalman gain is 5/8 = 0.625. Updated mean is 10 + 0.625 × 4 = 12.5, and updated variance is (1 − 0.625) × 5 = 1.875.
An independent precision calculation confirms the result: combined variance is 1/(1/5 + 1/3) = 1.875, and combined mean is (10/5 + 14/3)/(1/5 + 1/3) = 12.5. The measurement receives more weight because its variance 3 is lower than the predicted state's variance 5.
Under the stipulated Gaussian model this update is exact. If the observation is biased, its noise is correlated with the prediction error, or the variances are wrong, the calculation no longer supports the same interpretation. A smaller reported variance is not proof of smaller actual error.
Illustrative case study
Illustrative fictional case: Hawthorn Sensors combines a motion model with position readings in a warehouse prototype. Engineers initially set measurement variance too low, causing the estimate to follow occasional bad readings too strongly.
They examine innovations, compare predictions with independent reference measurements, and revise their calibration procedure. They also test missed readings and abrupt motion changes. The fictional case illustrates how assumptions and diagnostics determine practical performance; the filter's name alone does not establish reliability.
Common misconceptions and mistakes
A Kalman filter is not universally optimal. The usual exact Bayesian result depends on a linear Gaussian model, known parameters, and the required independence or covariance structure. Nonlinear systems motivate alternatives such as extended or unscented Kalman filters, which have different approximation properties.
Do not confuse process noise with sensor noise, or standard deviation with variance. A measurement variance of 3 does not mean a standard deviation of 3. Nor does filtering use future evidence: revising a past state with later observations is smoothing. Numerical implementation should preserve a valid covariance matrix rather than assuming every algebraically equivalent expression behaves equally well in finite precision.
Business use
Kalman filtering can support real-time estimation with modest state storage and interpretable uncertainty. It is particularly useful when an organization has a credible dynamic model and recurring observations.
Define state units, transition timing, sensor relationships, noise assumptions, and initialization. Evaluate both point errors and uncertainty calibration across representative operating conditions. Plan how the system behaves without observations, and investigate persistent innovation patterns that suggest bias, missing dynamics, or inconsistent noise settings.
People also ask
Does it require many sensors?
No. The worked example uses one direct measurement.
What happens when a reading is missing?
The state can be predicted forward without that measurement correction, typically retaining or accumulating more uncertainty according to the model.
Is it a machine-learning algorithm?
It is a statistical state-estimation algorithm often used within AI and machine-learning systems; its parameters may be supplied or estimated.
Check your understanding
Why does predicted variance rise from 4 to 5?
Answer: The independent process noise adds variance 1 during the transition.
What determines the gain 0.625?
Answer: The ratio of predicted variance 5 to total innovation variance 8 in this scalar direct-observation model.
Is the updated mean simply the average of 10 and 14?
Answer: No. Equal averaging would give 12; the uncertainty-weighted result is 12.5.
Related terms
- Filtering
- Covariance
- Observability (software)
- Extended Kalman filter
- Smoothing
- state-space model
- innovation
- Kalman gain
- process noise
- measurement noise
- observability
Learn next
vary the two variances in the scalar example and observe how the gain changes. Then extend to a position-and-velocity state, keeping units and covariance relationships explicit before experimenting with nonlinear models.
More in Time series and signal processing
- Holt-Winters forecasting - Holt-Winters forecasting is a family of exponential-smoothing methods that represents a time series through level, trend, and repeating seasonal components.
- Homoscedasticity - Homoscedasticity means that an error or outcome distribution has the same variance across the conditions being considered.
- Impulse response weights - Impulse response weights describe how a dynamic model's output responds over successive time lags to a one-time unit input or shock.
- Lagrange dual function - The Lagrange dual function is obtained by taking the infimum of a problem's Lagrangian over its original decision variables, while holding the multipliers...
- Lagrangian - A Lagrangian is a function that combines an optimization objective with weighted constraint expressions. The weights are called Lagrange multipliers.
- Laplace smoothing - Laplace smoothing, also called add-one smoothing, estimates probabilities from categorical counts by adding one to every category count before normalizing.
Sources
Sources: Thomas Minka, A Statistical Learning/Pattern Recognition Glossary: https://alumni.media.mit.edu/~tpminka/statlearn/glossary/glossary.html . MathWorks, official Linear Kalman Filters documentation: https://www.mathworks.com/help/radar/ug/linear-kalman-filters.html . Primary glossary and documentation consulted. The scalar example was independently verified using both Kalman and precision formulas; the case is fictional.
Previous: Kaiser - Meyer - Olkin test Next: Kalman gain matrix