A Kalman filter is an algorithm that estimates unknown values from a series of noisy, imprecise measurements over time. It works by combining what it predicts should happen next with what it actually observes, continuously refining its estimate to be more accurate than any single measurement alone. Originally developed for aerospace navigation in the early 1960s, it now shows up everywhere from smartphone GPS to stock market modeling.
The core idea is surprisingly intuitive: if you have a rough prediction of where something should be and a rough measurement of where it actually is, you can combine both pieces of information intelligently to get a better answer than either one gives you on its own.
The Two-Step Cycle: Predict, Then Update
The Kalman filter runs in a repeating loop with two phases. In the predict step, the filter uses everything it knows so far to make a forecast. If you’re tracking a car, for example, and you know its current position and speed, you can predict where it will be one second from now. This prediction carries some uncertainty, because the car might accelerate or hit a bump.
In the update step, the filter takes a new measurement (say, a GPS reading) and compares it to that prediction. The difference between what was predicted and what was measured is called the “innovation.” The filter then adjusts its estimate by adding a weighted portion of that innovation back into the prediction. This corrected estimate becomes the starting point for the next cycle, and the loop repeats.
What makes this powerful is that the filter doesn’t just track a value. It also tracks how confident it is in that value. Each cycle, the uncertainty shrinks as new measurements arrive, so the estimate gets more precise over time.
How the Kalman Gain Works
The key ingredient that makes the whole thing “optimal” is the Kalman gain, a weighting factor that decides how much to trust the new measurement versus the prediction. If your prediction is very uncertain but your sensor is highly accurate, the gain will be high, pulling the estimate strongly toward the measurement. If the opposite is true, the gain will be low, and the filter will mostly stick with its prediction.
Think of it like averaging two friends’ opinions, but giving more weight to whichever friend has been more reliable. The Kalman gain calculates that weighting automatically at every time step, based on how much uncertainty exists in both the prediction and the measurement. The formal definition describes the optimal gain as the choice of weights that most reduces the uncertainty in the updated estimate.
Handling Noise and Uncertainty
Real-world sensors are never perfect. A GPS chip might place you 5 meters from your actual location. An accelerometer in your phone drifts over time. The Kalman filter handles this by explicitly modeling two types of noise.
Process noise represents unpredictable changes in the system itself. A drone might get buffeted by wind, or a stock price might jump on unexpected news. Measurement noise represents the inaccuracy of your sensors or data sources. Both types of noise are described by covariance values that tell the filter how much randomness to expect. In practice, these noise values are often not known precisely and need to be tuned, which is one of the trickier parts of setting up a Kalman filter.
The classic Kalman filter assumes both types of noise follow a bell-curve (Gaussian) distribution. This assumption is what allows the math to stay clean and the filter to run efficiently. It also means the filter works best when errors are random and symmetrical, not when they come in sudden, extreme spikes.
Where Kalman Filters Are Used
The filter was originally developed for spacecraft navigation, and aerospace remains one of its signature applications. Every time a rocket or satellite combines readings from gyroscopes, accelerometers, and star trackers into a single smooth trajectory, a Kalman filter (or a close relative) is doing the work.
In everyday technology, your phone’s GPS uses a Kalman filter to smooth out the jumpy raw satellite signals into the smooth blue dot moving along a map. Self-driving cars fuse data from cameras, radar, and lidar using variants of the filter. Robotics applications use it to combine motion sensor data to calculate orientation angles like pitch and roll.
In finance, the filter estimates values that can’t be directly observed, like the true underlying volatility of a stock or the convenience yield of a commodity. Researchers have applied it to S&P 500 time series data to calibrate stochastic volatility models, and to crude oil futures prices to estimate term structure models. The general pattern is the same: you have observable data (stock prices, futures prices, interest rates) and unobservable quantities (volatility, correlation) that you want to infer, and the filter iteratively refines those hidden estimates as new market data arrives.
Variants for Nonlinear Systems
The standard Kalman filter only works perfectly when the system’s behavior can be described by linear equations. Many real systems, like a tumbling satellite or a vehicle making sharp turns, are nonlinear. Two common adaptations handle this.
The Extended Kalman Filter (EKF) linearizes the system at each time step by taking a mathematical approximation (essentially zooming in until the curve looks like a straight line). It’s the most widely used variant and works well when the nonlinearity isn’t too extreme, but the approximation can introduce errors.
The Unscented Kalman Filter (UKF) takes a different approach. Instead of approximating the equations, it picks a small set of carefully chosen sample points, runs them through the actual nonlinear equations, and reconstructs the estimate from the results. In sensor fusion tests comparing the two, the UKF produced lower errors: for pitch angle estimation, the UKF achieved a root mean square error of 1.97° versus 2.12° for the EKF, and for roll, 2.70° versus 2.84°. The UKF is generally more accurate but slightly more computationally expensive.
Kalman Filter vs. Particle Filter
For problems where the noise isn’t Gaussian or the system is highly nonlinear, a completely different approach called a particle filter can be used. Instead of tracking a single estimate with a bell-curve of uncertainty, a particle filter represents uncertainty using hundreds or thousands of random samples (“particles”), each one a possible state of the system.
The tradeoff is straightforward. Kalman filters are fast, elegant, and give exact solutions for linear systems with Gaussian noise. Particle filters can handle nearly any kind of noise distribution and nonlinearity, but they require much more computing power. In scenarios where sensor noise is well-behaved and rarely produces extreme outliers, both approaches perform comparably. The Kalman filter’s speed advantage makes it the default choice for most engineering applications, with particle filters reserved for problems where its assumptions break down.
Why It Matters
The Kalman filter’s lasting influence comes from a simple but broadly useful insight: you can combine imperfect knowledge about how a system behaves with imperfect measurements of that system, and the result will be better than either source alone. It runs recursively, meaning it only needs the current estimate and the latest measurement, not the entire history of past data. This makes it fast enough to run in real time on cheap hardware, which is why it ended up inside everything from missile guidance systems to fitness trackers. If you’ve ever watched a GPS dot glide smoothly along a road instead of jumping between buildings, you’ve seen a Kalman filter at work.

