Skip to content
— CH. 1 · INTRODUCTION —

Kalman filter

~7 min read · Ch. 1 of 6
6 sections
  • 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

  1. 2bookFundamentals of Kalman Filtering: A Practical ApproachPaul Zarchan et al. — American Institute of Aeronautics and Astronautics, Incorporated — 2000
  2. 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
  3. 4journalMoving Object Detection Based on a Combination of Kalman Filter and Median FilteringDiana Kalita et al. — December 2022
  4. 5bookApplied Economic Forecasting using Time Series MethodsEric Ghysels et al. — Oxford University Press — 2018
  5. 6journalComputational principles of movement neuroscienceDaniel Wolpert et al. — 2000
  6. 8journalA Fresh Look at the Kalman FilterJeffrey Humpherys — 2012
  7. 10journalA Survey on Multisensor Fusion and Consensus Filtering for Sensor NetworksWangyan Li et al. — 2015
  8. 11journalOn Boundedness of Error Covariances for Kalman Consensus Filtering ProblemsWangyan Li et al. — 2019
  9. 12journalTime series analysis in 1880. A discussion of contributions made by T.N. ThieleS. L. Lauritzen — December 1981
  10. 13bookThiele: Pioneer in StatisticsS. L. Lauritzen — Oxford University Press — 2002
  11. 14bookKalman filtering: theory and practice using MATLABMohinder S. Grewal et al. — Wiley — 2015
  12. 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
  13. 20journalУсловные процессы МарковаR. L. Stratonovich — 1960
  14. 22bookAIAA Guidance, Navigation, and Control Conference and ExhibitDavid Gaylor et al. — 2003
  15. 23journalBlock Kalman Filtering for Large-Scale DSGE ModelsIngvar Strid et al. — April 2009
  16. 25journalA unifying review of linear gaussian modelsS Roweis et al. — 1999
  17. 26bookTime Series AnalysisJ. Hamilton — Princeton University Press — 1994
  18. 27journalRobust Kalman Filter for Descriptor SystemsJ.Y. Ishihara et al. — 2006
  19. 28journalOptimal Robust Linear Quadratic Regulator for Systems Subject to UncertaintiesMarco H. Terra et al. — 2014
  20. 30webEstimation IIIan Reid et al. — Oxford University
  21. 32journalEstimation of the disturbance structure from data using semidefinite programming and optimal weightingMurali R. Rajamani et al. — 2009
  22. 33webAutocovariance Least-Squares ToolboxJbrwww.che.wisc.edu
  23. 34conferenceField Kalman Filter and its approximationP. Bania et al. — IEEE — 12 December 2016
  24. 35journalOptimization or Architecture: How to Hack Kalman FilteringIdo Greenberg et al. — 2023-12-15
  25. 36bookEstimation with Applications to Tracking and NavigationYaakov Bar-Shalom et al. — John Wiley & Sons, Inc. — 2001
  26. 37book16th IFAC Symposium on System IdentificationMatisko Peter — 2012
  27. 38journalThe Kantorovich inequality for error analysis of the Kalman filter with unknown noise distributionsJames C. Spall — 1995
  28. 39journalUse of the Kalman Filter for Inference in State-Space Models with Unknown Noise DistributionsJ.L. Maryak et al. — 2004
  29. 40bookRandom processes in Systems -- Lecture NotesJean Walrand et al. — August 2006
  30. 41reportFundamental study of adaptive control systemsRudolf Emil Kalman et al. — Clearinghouse, US Department of Commerce — 1962
  31. 42journalExponential Convergence Rate and Oscillatory Modes of the Asymptotic Kalman Filter CovarianceDaniel C. Herbst — 2024
  32. 44bookOptimal FilteringBrian D. O. Anderson et al. — Prentice Hall — 1979
  33. 46thesisTriangular Covariance Factorizations for Kalman FilteringCatherine L. Thornton — NASA — 15 October 1976
  34. 47bookEstimation with Applications to Tracking and NavigationYaakov Bar-Shalom et al. — John Wiley & Sons — July 2001
  35. 48bookMatrix ComputationsGene H. Golub et al. — Johns Hopkins University — 1996
  36. 49bookAccuracy and Stability of Numerical AlgorithmsNicholas J. Higham — Society for Industrial and Applied Mathematics — 2002
  37. 50journalTemporal Parallelization of Bayesian SmoothersSärkkä, S. — 2021
  38. 52journalRobust Bayesian estimation for the linear model and robustifying the Kalman filterC. Johan Masreliez et al. — 1977
  39. 53bookIntroduction to Multiple Time Series AnalysisHelmut Lütkepohl — Springer-Verlag Berlin — 1991
  40. 54bookStatistical sensor fusionFredrik Gustafsson — Studentlitteratur — 2018
  41. 55webDiscrete Kalman Filter TutorialGabriel T. Terejanu — 2012-08-04
  42. 56bookOptimal FilteringBrian D. O. Anderson et al. — Prentice Hall, Inc. — 1979
  43. 57journalMaximum likelihood estimates of linear dynamic systemsH.E. Rauch et al. — August 1965
  44. 58journalFactorization Methods for Discrete Sequential EstimationG.J. Bierman — 1977
  45. 59journalSquare Root Modified Bryson–Frazier SmootherRichard G. Gibbs — February 2011
  46. 60journalNew Kalman filter and smoother consistency testsRichard G. Gibbs — 2013
  47. 61journalOptimal and Robust Noncausal Filter FormulationsG.A. Einicke — March 2006
  48. 62journalAsymptotic Optimality of the Minimum-Variance Fixed-Interval SmootherG.A. Einicke — April 2007
  49. 63journalLongwall Mining Automation. An Application of Minimum-Variance SmoothingG.A. Einicke et al. — December 2008
  50. 64journalAsymptotic Optimality of the Minimum-Variance Fixed-Interval SmootherG.A. Einicke — December 2009
  51. 65journalLoudness, Its Definition, Measurement and CalculationHarvey Fletcher et al. — October 1933
  52. 66journalIterative Frequency-Weighted Filtering and Smoothing ProceduresG.A. Einicke — December 2014
  53. 68journalUnscented filtering and nonlinear estimationJulier, Simon J. et al. — 2004
  54. 69bookSignal Processing, Sensor Fusion, and Target Recognition VIJulier, Simon J. et al. — 1997
  55. 70journalA Systematization of the Unscented Kalman Filter TheoryH. M. T. Menegaz et al. — October 2015
  56. 72book2001 IEEE International Conference on Acoustics, Speech, and Signal Processing. Proceedings (Cat. No.01CH37221)R. Van der Merwe et al. — 2001
  57. 73bookProceedings of the IEEE 2000 Adaptive Systems for Signal Processing, Communications, and Control Symposium (Cat. No.00EX373)E.A. Wan et al. — 2000
  58. 74journalOn Unscented Kalman Filtering for State Estimation of Continuous-Time Nonlinear SystemsSimo Sarkka — September 2007
  59. 76thesisA Discriminative Approach to Bayesian Filtering with Applications to Human Neural DecodingMichael C. Burkhart — Brown University — 2019
  60. 78bookFiltering for Stochastic Processes with Applications to GuidanceR.S. Bucy et al. — John Wiley & Sons — 2005
  61. 79bookStochastic processes and filtering theoryAndrew H. Jazwinski — Academic Press — 1970
  62. 80journalAn innovations approach to least-squares estimation--Part I: Linear filtering in additive white noiseT. Kailath — 1968
  63. 81book2008 15th IEEE International Conference on Image ProcessingNamrata Vaswani — 2008
  64. 82journalMethods for sparse signal recovery using Kalman filtering with embedded pseudo-measurement norms and quasi-normsAvishy Carmi et al. — 2010
  65. 83journalDynamic Iterative PursuitDave Zachariah et al. — 2012
  66. 84arxivOn the relation between Gaussian process quadratures and sigma-point methodsSimo Särkkä et al. — 2015-04-22
  67. 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
  68. 86journalPredicting state of charge of lead-acid batteries for hybrid electric vehicles by extended Kalman filterA. Vasebi et al. — 2008
  69. 87journalApplication of Kalman filtering to track and vertex fittingR. Fruhwirth — 1987
  70. 88bookAdvances in EconometricsAndrew C. Harvey — Cambridge University Press — 1994
  71. 89journalForward Models for Physiological Motor ControlD. M. Wolpert et al. — 1996
  72. 90journalTwo-dimensional restoration of single photon emission computed tomography images using the Kalman filterD. Boulfelfel et al. — 1994
  73. 91journalFusion of High-Rate GPS and Seismic Data: Applications to Early Warning Systems for Mitigation of Geological HazardsY. Bock et al. — 2008