Kalman filter
The Kalman filter is the hidden arithmetic behind some of the most consequential machines ever built. It flew to the Moon inside the Apollo navigation computer. It steers U.S. Navy nuclear ballistic missile submarines through the deep. It guides cruise missiles like the Tomahawk to within meters of their targets. And right now, somewhere in the world, a truck driver has no idea that the smooth GPS reading on their dashboard is only that smooth because of a recursive algorithm published in 1960.
At its heart, the Kalman filter answers a question that haunts every measurement ever taken: if your sensors are noisy and your models are imperfect, what is your best possible guess about what is actually happening? The answer, it turns out, is not to trust one reading. It is to combine every piece of evidence you have, weight it by how reliable it is, and update your estimate every single time a new measurement arrives.
The filter is named for Rudolf E. Kalman, a Hungarian emigre whose ideas were so ahead of their time that the Soviet mathematician Ruslan Stratonovich had already published some of the same equations before the two men met at a conference in Moscow in the summer of 1961. Who deserves credit, how the algorithm found its way into the Apollo program, and why the most widely used version of the filter is now found in virtually every FM radio on Earth are the threads this story will follow.
Rudolf Kálmán did not invent the problem of noisy measurement. Norbert Wiener had already attacked it, producing what became known as the Wiener filter. What Kálmán did was reframe the problem using state variables, a move that changed everything. By thinking about a system's hidden internal condition rather than just its observable outputs, he opened a path to an algorithm that could run in real time, updating itself moment by moment with no need to store or reprocess the past.
The algorithm works in two distinct phases. In the prediction phase, the filter uses a mathematical model of how the system behaves to project forward: given where things were, where should they be now? In the update phase, a new measurement arrives. That measurement is noisy, necessarily corrupted with some error. The filter does not simply replace its prediction with the measurement. Instead, it forms a weighted average. Estimates with smaller uncertainty are trusted more. The result lands between the predicted state and the measured state, and its uncertainty is smaller than either alone.
This process repeats at every time step. Each cycle needs only the previous best estimate and its uncertainty matrix. No history of observations is required. Stanley F. Schmidt, who is generally credited with developing the first implementation, recognized that this recursive structure meant the filter could be divided into two distinct processing stages. It was that recognition, made during a visit by Kálmán to the NASA Ames Research Center, that led Schmidt to see how the algorithm could solve the nonlinear problem of trajectory estimation for the Apollo program.
The Apollo navigation computer had 2k of magnetic core RAM and 36k of wire rope memory. Its clock speed ran under 100 kHz. By the standards of any era that came after, it was a device of almost laughable constraint. Yet MIT engineers packed into it one of the very first real applications of the Kalman filter, and it worked. Astronauts navigated to the Moon and back.
The Kalman filter's arrival in military systems was equally consequential. The navigation systems of U.S. Navy nuclear ballistic missile submarines depend on it. The guidance and navigation of the Tomahawk cruise missile rely on it, as does the U.S. Air Force's Air Launched Cruise Missile. Spacecraft that dock at the International Space Station use it for attitude control and navigation.
The path to these applications ran through the work of Kálmán and Richard S. Bucy of the Johns Hopkins Applied Physics Laboratory, whose contributions were significant enough that the algorithm is sometimes called Kalman-Bucy filtering. The continuous-time version of the filter, which Bucy helped develop, is now formally named the Kalman-Bucy filter. The original technical papers appeared in 1958 from Swerling, in 1960 from Kalman, and in 1961 from Kalman and Bucy together.
In his own words, Rudolf Kálmán specified that "the primary sources are assumed to be independent Gaussian random processes with zero mean; the dynamic systems will be linear." That sentence contains the filter's most important constraint and one of its most persistent misunderstandings at once.
The misunderstanding, which has been perpetuated in the technical literature, is the belief that the Kalman filter cannot be rigorously applied unless all noise processes are Gaussian. This is not true. If the process and measurement covariances are known, the Kalman filter is the best possible linear estimator in the minimum mean-square-error sense regardless of whether the noise is Gaussian. There may be better nonlinear estimators in the non-Gaussian case, but the filter's claim as the optimal linear estimator stands.
The harder practical problem is getting good estimates of the noise covariance matrices in the first place. Knowing how much your sensors are wrong, and how much your model of the world is wrong, is not always possible from theory alone. The autocovariance least-squares technique addresses this by using time-lagged autocovariances of routine operating data. GNU Octave and Matlab code for this technique is available under the GNU General Public License. A more recent approach, the Optimized Kalman Filter, treats the covariance matrices not as descriptions of noise but as tunable parameters aimed directly at achieving the most accurate state estimation possible.
Real physical systems rarely behave as cleanly as the linear model assumes. A spacecraft maneuvering through a gravitational field, a robot navigating a cluttered environment, an aircraft responding to turbulence all involve nonlinearities that the basic filter cannot directly handle. Two descendants of the original algorithm address this.
The Extended Kalman Filter, often abbreviated EKF, handles nonlinear systems by linearizing around the current estimate at each time step. It computes a matrix of partial derivatives, the Jacobian, of the nonlinear transition and observation functions. This local linearization lets the rest of the filter proceed as normal. Schmidt's original application to the Apollo trajectory problem was itself an extended filter, which is why it is sometimes called Schmidt's extended filter in the historical taxonomy.
When the nonlinearity is severe, the EKF's linearization can produce poor results because it propagates the covariance through that local approximation rather than through the true nonlinear function. The Unscented Kalman Filter takes a different approach. It selects a minimal set of sample points, called sigma points, that capture the mean and covariance of the current estimate, propagates those points through the nonlinear functions directly, and then reconstructs the mean and covariance from the result. A typical recommended parameterization uses values of alpha equal to 0.001, beta equal to 2, and kappa equal to 0 when the true distribution is Gaussian. This approach also removes the requirement to calculate Jacobians, which can be analytically difficult or computationally costly for complex functions.
Thorvald Nicolai Thiele and Peter Swerling each developed similar algorithms before Kálmán published in 1960. The filter's independent rediscovery by Stratonovich, whose papers on the linear special case appeared before the two men met in Moscow, reflects how naturally the idea arises from a general set of mathematical pressures. A family of solutions was converging on the same structure from multiple directions.
The variants that have accumulated since are numerous. The information filter, which inverts the covariance matrix and represents state as an information vector, becomes more efficient when the number of observations exceeds the dimension of the state. Square-root filters, developed by Bierman and Thornton among others, address numerical instability by factoring the covariance matrix into a product form that guarantees positive-definiteness even when round-off error would otherwise corrupt it. The U-D decomposition, where the matrix is expressed as the product of a unit triangular matrix and a diagonal matrix, uses the same storage as the Cholesky factorization but somewhat less computation.
Perhaps the most ubiquitous descendant is the phase-locked loop. It is now found in FM radios, television sets, satellite communications receivers, and nearly any other electronic communications equipment. Most people who have never heard the name Kalman have nonetheless relied on his algorithm every time they tuned a radio. The application to modeling the central nervous system's control of movement adds one more domain: human neuroscience now uses the filter as a realistic model of how the brain estimates the current state of the motor system and issues updated commands, accounting for the time delay between motor commands and sensory feedback.
Common questions
What is the Kalman filter used for?
The Kalman filter is an algorithm that estimates unknown variables from a series of noisy measurements over time. It is used in aircraft, spacecraft, and ship navigation; cruise missile guidance such as the U.S. Navy Tomahawk; GPS-based positioning; signal processing; econometrics; robotic motion planning; and modeling the central nervous system's control of movement.
Who invented the Kalman filter?
The filter is named for Rudolf E. Kálmán, a Hungarian emigre who published the foundational paper in 1960. Richard S. Bucy of the Johns Hopkins Applied Physics Laboratory contributed to the theory, leading to the name Kalman-Bucy filtering. Thorvald Nicolai Thiele and Peter Swerling developed similar algorithms earlier, and Soviet mathematician Ruslan Stratonovich independently published some of the same linear filter equations before 1961.
How was the Kalman filter first used in the Apollo program?
Stanley F. Schmidt, generally credited with the first implementation of the Kalman filter, recognized its applicability to the nonlinear problem of trajectory estimation during a visit by Kálmán to the NASA Ames Research Center. The filter was incorporated into the Apollo navigation computer, which had only 2k of magnetic core RAM and ran at under 100 kHz, making it one of the very first real applications of the algorithm.
How does the Kalman filter prediction and update process work?
The Kalman filter operates in two alternating phases. In the prediction phase, it uses a mathematical model of the system to project the current state estimate forward in time. In the update phase, a new measurement is combined with the prediction using a weighted average, where estimates with smaller uncertainty receive more weight. The algorithm is recursive, requiring only the previous best estimate and its uncertainty matrix, not the full history of observations.
What is the difference between the Extended Kalman Filter and the Unscented Kalman Filter?
The Extended Kalman Filter handles nonlinear systems by linearizing the transition and observation functions around the current estimate using their Jacobian matrices at each time step. The Unscented Kalman Filter instead selects a set of sample points called sigma points that represent the current mean and covariance, propagates them directly through the nonlinear functions, and reconstructs the mean and covariance from the result, avoiding explicit Jacobian calculations.
Does the Kalman filter require Gaussian noise to work?
No. A common misconception, perpetuated in the technical literature, holds that the Kalman filter requires all noise processes to be Gaussian. In fact, if the process and measurement covariances are known, the Kalman filter is the best possible linear estimator in the minimum mean-square-error sense regardless of the noise distribution. There may be better nonlinear estimators in non-Gaussian cases, but the filter's optimality as a linear estimator does not depend on Gaussianity.
All sources
91 references cited across the entry
- 1webChapter 11 Tutorial: The Kalman FilterTony Lacey
- 2bookFundamentals of Kalman Filtering: A Practical ApproachPaul Zarchan et al. — American Institute of Aeronautics and Astronautics, Incorporated — 2000
- 3journalAn IMUs-Based Extended Kalman Filter to Estimate Gait Lower Limb Sagittal Kinematics for the Control of Wearable Robotic DevicesJulio S. Lora-Millan et al. — 2021
- 4journalMoving Object Detection Based on a Combination of Kalman Filter and Median FilteringDiana Kalita et al. — December 2022
- 5bookApplied Economic Forecasting using Time Series MethodsEric Ghysels et al. — Oxford University Press — 2018
- 6journalComputational principles of movement neuroscienceDaniel Wolpert et al. — 2000
- 7journalA New Approach to Linear Filtering and Prediction ProblemsR. E. Kalman — 1960
- 8journalA Fresh Look at the Kalman FilterJeffrey Humpherys — 2012
- 9journalGaussianity and the Kalman Filter: A Simple Yet Complicated RelationshipJeffrey Uhlmann et al. — 2022
- 10journalA Survey on Multisensor Fusion and Consensus Filtering for Sensor NetworksWangyan Li et al. — 2015
- 11journalOn Boundedness of Error Covariances for Kalman Consensus Filtering ProblemsWangyan Li et al. — 2019
- 12journalTime series analysis in 1880. A discussion of contributions made by T.N. ThieleS. L. Lauritzen — December 1981
- 13bookThiele: Pioneer in StatisticsS. L. Lauritzen — Oxford University Press — 2002
- 14bookKalman filtering: theory and practice using MATLABMohinder S. Grewal et al. — Wiley — 2015
- 16reportA Linearized Error Analysis Of Onboard Primary Navigation Systems For The Apollo Lunar Module, NASA TN D-4027Jerrold H. Suddath — National Aeronautics and Space Administration — August 1967
- 17journalОптимальные нелинейные системы, осуществляющие выделение сигнала с постоянными параметрами из шумаR. L. Stratonovich — 1959
- 18journalК теории оптимальной нелинейной фильтрации случайных функцийR. L. Stratonovich — 1959
- 19journalПрименение теории марковских процессов для оптимальной фильтрации сигналовR. L. Stratonovich — 1960
- 20journalУсловные процессы МарковаR. L. Stratonovich — 1960
- 21journalKalman filtering: Past and present. An outlook from Russia. (On the occasion of the 80th birthday of Rudolf Emil Kalman)O. A. Stepanov — 15 May 2011
- 22bookAIAA Guidance, Navigation, and Control Conference and ExhibitDavid Gaylor et al. — 2003
- 23journalBlock Kalman Filtering for Large-Scale DSGE ModelsIngvar Strid et al. — April 2009
- 24webNon-linear DSGE Models, The Central Difference Kalman Filter, and The Mean Shifted Particle FilterMartin Møller Andreasen — 2008
- 25journalA unifying review of linear gaussian modelsS Roweis et al. — 1999
- 26bookTime Series AnalysisJ. Hamilton — Princeton University Press — 1994
- 27journalRobust Kalman Filter for Descriptor SystemsJ.Y. Ishihara et al. — 2006
- 28journalOptimal Robust Linear Quadratic Regulator for Systems Subject to UncertaintiesMarco H. Terra et al. — 2014
- 29journalA 3D state space formulation of a navigation Kalman filter for autonomous vehiclesAlonzo Kelly — 1994
- 30webEstimation IIIan Reid et al. — Oxford University
- 31thesisData-based Techniques to Improve State Estimation in Model Predictive ControlMurali Rajamani — October 2007
- 32journalEstimation of the disturbance structure from data using semidefinite programming and optimal weightingMurali R. Rajamani et al. — 2009
- 33webAutocovariance Least-Squares ToolboxJbrwww.che.wisc.edu
- 34conferenceField Kalman Filter and its approximationP. Bania et al. — IEEE — 12 December 2016
- 35journalOptimization or Architecture: How to Hack Kalman FilteringIdo Greenberg et al. — 2023-12-15
- 36bookEstimation with Applications to Tracking and NavigationYaakov Bar-Shalom et al. — John Wiley & Sons, Inc. — 2001
- 37book16th IFAC Symposium on System IdentificationMatisko Peter — 2012
- 38journalThe Kantorovich inequality for error analysis of the Kalman filter with unknown noise distributionsJames C. Spall — 1995
- 39journalUse of the Kalman Filter for Inference in State-Space Models with Unknown Noise DistributionsJ.L. Maryak et al. — 2004
- 40bookRandom processes in Systems -- Lecture NotesJean Walrand et al. — August 2006
- 41reportFundamental study of adaptive control systemsRudolf Emil Kalman et al. — Clearinghouse, US Department of Commerce — 1962
- 42journalExponential Convergence Rate and Oscillatory Modes of the Asymptotic Kalman Filter CovarianceDaniel C. Herbst — 2024
- 43journalGeneralized least squares applied to time varying parameter modelsDonald T. Sant — NBER — 1977
- 44bookOptimal FilteringBrian D. O. Anderson et al. — Prentice Hall — 1979
- 45conferenceFalse information injection attack on dynamic state estimation in multi-sensor systemsJingyang Lu — 2014
- 46thesisTriangular Covariance Factorizations for Kalman FilteringCatherine L. Thornton — NASA — 15 October 1976
- 47bookEstimation with Applications to Tracking and NavigationYaakov Bar-Shalom et al. — John Wiley & Sons — July 2001
- 48bookMatrix ComputationsGene H. Golub et al. — Johns Hopkins University — 1996
- 49bookAccuracy and Stability of Numerical AlgorithmsNicholas J. Higham — Society for Industrial and Applied Mathematics — 2002
- 50journalTemporal Parallelization of Bayesian SmoothersSärkkä, S. — 2021
- 52journalRobust Bayesian estimation for the linear model and robustifying the Kalman filterC. Johan Masreliez et al. — 1977
- 53bookIntroduction to Multiple Time Series AnalysisHelmut Lütkepohl — Springer-Verlag Berlin — 1991
- 54bookStatistical sensor fusionFredrik Gustafsson — Studentlitteratur — 2018
- 55webDiscrete Kalman Filter TutorialGabriel T. Terejanu — 2012-08-04
- 56bookOptimal FilteringBrian D. O. Anderson et al. — Prentice Hall, Inc. — 1979
- 57journalMaximum likelihood estimates of linear dynamic systemsH.E. Rauch et al. — August 1965
- 58journalFactorization Methods for Discrete Sequential EstimationG.J. Bierman — 1977
- 59journalSquare Root Modified Bryson–Frazier SmootherRichard G. Gibbs — February 2011
- 60journalNew Kalman filter and smoother consistency testsRichard G. Gibbs — 2013
- 61journalOptimal and Robust Noncausal Filter FormulationsG.A. Einicke — March 2006
- 62journalAsymptotic Optimality of the Minimum-Variance Fixed-Interval SmootherG.A. Einicke — April 2007
- 63journalLongwall Mining Automation. An Application of Minimum-Variance SmoothingG.A. Einicke et al. — December 2008
- 64journalAsymptotic Optimality of the Minimum-Variance Fixed-Interval SmootherG.A. Einicke — December 2009
- 65journalLoudness, Its Definition, Measurement and CalculationHarvey Fletcher et al. — October 1933
- 66journalIterative Frequency-Weighted Filtering and Smoothing ProceduresG.A. Einicke — December 2014
- 67journalA quantified approach of predicting suitability of using the Unscented Kalman Filter in a non-linear applicationSanat K. Biswas et al. — 2020-12-01
- 68journalUnscented filtering and nonlinear estimationJulier, Simon J. et al. — 2004
- 69bookSignal Processing, Sensor Fusion, and Target Recognition VIJulier, Simon J. et al. — 1997
- 70journalA Systematization of the Unscented Kalman Filter TheoryH. M. T. Menegaz et al. — October 2015
- 71journalSome Relations Between Extended and Unscented Kalman FiltersGustafsson, Fredrik — 2012
- 72book2001 IEEE International Conference on Acoustics, Speech, and Signal Processing. Proceedings (Cat. No.01CH37221)R. Van der Merwe et al. — 2001
- 73bookProceedings of the IEEE 2000 Adaptive Systems for Signal Processing, Communications, and Control Symposium (Cat. No.00EX373)E.A. Wan et al. — 2000
- 74journalOn Unscented Kalman Filtering for State Estimation of Continuous-Time Nonlinear SystemsSimo Sarkka — September 2007
- 75journalThe Discriminative Kalman Filter for Bayesian Filtering with Nonlinear and Nongaussian Observation ModelsMichael C. Burkhart et al. — 2020
- 76thesisA Discriminative Approach to Bayesian Filtering with Applications to Human Neural DecodingMichael C. Burkhart — Brown University — 2019
- 77journalRobust Closed-Loop Control of a Cursor in a Person with Tetraplegia using Gaussian Process RegressionDavid M. Brandman et al. — 2018
- 78bookFiltering for Stochastic Processes with Applications to GuidanceR.S. Bucy et al. — John Wiley & Sons — 2005
- 79bookStochastic processes and filtering theoryAndrew H. Jazwinski — Academic Press — 1970
- 80journalAn innovations approach to least-squares estimation--Part I: Linear filtering in additive white noiseT. Kailath — 1968
- 81book2008 15th IEEE International Conference on Image ProcessingNamrata Vaswani — 2008
- 82journalMethods for sparse signal recovery using Kalman filtering with embedded pseudo-measurement norms and quasi-normsAvishy Carmi et al. — 2010
- 83journalDynamic Iterative PursuitDave Zachariah et al. — 2012
- 84arxivOn the relation between Gaussian process quadratures and sigma-point methodsSimo Särkkä et al. — 2015-04-22
- 85journalA novel combined battery model for state-of-charge estimation in lead-acid batteries based on extended Kalman filter for hybrid electric vehicle applicationsAmir Vasebi et al. — 2007
- 86journalPredicting state of charge of lead-acid batteries for hybrid electric vehicles by extended Kalman filterA. Vasebi et al. — 2008
- 87journalApplication of Kalman filtering to track and vertex fittingR. Fruhwirth — 1987
- 88bookAdvances in EconometricsAndrew C. Harvey — Cambridge University Press — 1994
- 89journalForward Models for Physiological Motor ControlD. M. Wolpert et al. — 1996
- 90journalTwo-dimensional restoration of single photon emission computed tomography images using the Kalman filterD. Boulfelfel et al. — 1994
- 91journalFusion of High-Rate GPS and Seismic Data: Applications to Early Warning Systems for Mitigation of Geological HazardsY. Bock et al. — 2008