
A Kalman filter is a method for estimating the hidden state of a system as that system changes over time.
That sounds abstract, so let’s make it concrete.
Suppose we are tracking something that moves: a drone, a robot, a car, a satellite, or even a signal in a sensor. The object has a true state, but we do not get to observe that state perfectly.
For example, a drone has a true position and velocity. But our sensor may only give us a noisy measurement of position.
So we have two things:
1. The real state of the system.
2. A noisy observation of that state.
The job of the Kalman filter is to combine these two pieces of information over time.
It asks:
Given what I believed before, and given the noisy measurement I just received, what should I believe now?
This is the basic filtering problem.
What Is a Kalman Filter Used For?
Kalman filters are used for real-time state estimation.
They are common in navigation, robotics, aerospace engineering, control systems, computer vision, economics, and signal processing.
A classic example is GPS tracking.
GPS measurements are noisy. If you look at raw GPS data, the estimated position may jump around even when the object is moving smoothly. A Kalman filter can smooth those measurements by combining them with a motion model.
The motion model says something like:
If the object was here before, and it was moving with this velocity, then it should probably be over here now.
The measurement says:
The sensor thinks the object is here.
The Kalman filter combines both.
It does not blindly trust the model.
It does not blindly trust the sensor.
It balances them according to their uncertainty.
What Problems Are Kalman Filters Good For?
Kalman filters are especially good for problems where the system is approximately linear and the noise is approximately Gaussian.
In simple terms, this means:
- the system evolves in a fairly smooth way,
- measurements are noisy but not wildly unpredictable,
- uncertainty can be reasonably represented by a bell-shaped distribution.
The Kalman filter represents belief using two things:
- a mean,
- a covariance.
The mean is the best estimate of the hidden state.
The covariance describes how uncertain we are about that estimate.
So instead of storing every possible state the system could be in, the Kalman filter stores a compact summary of belief.
That is why it is so efficient.
A Simple Example
Suppose we are tracking a drone moving in one dimension.
The hidden state contains position and velocity.
The sensor only measures position, and the measurement is noisy.
At time t-1, suppose the drone is estimated to be at position 10 and moving with velocity 2.
Before seeing the next measurement, the model predicts that the drone should be near position 12.
That is the prediction step.
Then the sensor reports position 13.5.
Now we have a disagreement.
The model says: I expected the drone near 12.
The sensor says: I measured the drone near 13.5.
The Kalman filter combines these two pieces of information.
If the sensor is very reliable, the updated estimate moves closer to 13.5.
If the sensor is noisy, the updated estimate stays closer to 12.
This balance is controlled by the Kalman gain.
The Kalman gain determines how much the filter trusts the new measurement compared to the model prediction.
The Model
A standard Kalman filter assumes a linear state-space model.
The state evolves like this:
The observation is generated like this:
The first equation says that the current state depends on the previous state.
The second equation says that the observation is a noisy measurement of the current state.
Here, A describes the system dynamics. For example, it tells us how position and velocity change over time.
The matrix C describes what part of the hidden state we actually observe.
NOTE: We may care about both position and velocity, but only measure position directly. The velocity still matters because it helps predict future position.
The Bayesian View
The Kalman filter is a Bayesian filter.
That means it keeps updating a probability distribution over the hidden state as new observations arrive.
The object we want is the filtering distribution:
This means: the probability distribution of the current hidden state, given all observations so far.
The Kalman filter is special because, under linear Gaussian assumptions, this distribution stays Gaussian.
So the filter does not need to store a complicated distribution.
It only stores the mean and covariance.
That is the entire reason the Kalman filter is so clean.
Discussion
The Kalman filter is powerful because it is fast, elegant, and interpretable.
It is fast because it only updates a mean and covariance.
It is elegant because it gives the exact Bayesian filtering solution when the model is linear and Gaussian.
It is interpretable because the uncertainty has a clear meaning. If the covariance is large, the filter is uncertain. If the covariance is small, the filter is confident.
But the Kalman filter also has limitations.
The main limitation is that it represents uncertainty as one Gaussian distribution.
That is fine when the uncertainty has one main center.
But suppose a robot is in a building and there are two hallways that look almost identical. The robot may plausibly be in hallway A or hallway B.
That belief has two modes.
A Kalman filter may average those two possibilities and put the robot somewhere between the hallways, possibly inside a wall.
That is not just a bad estimate. It is a bad representation of uncertainty.
So the Kalman filter works best when one Gaussian belief is a reasonable approximation.
When the posterior distribution is nonlinear, non-Gaussian, or multimodal, we often need something more flexible.
That leads us to particle filters.
How to Think Through a Kalman Filter Problem
When setting up a Kalman filter, the hardest part is usually not the algebra. The hardest part is deciding what the hidden state should be and how the measurements relate to that state.
A good way to think through the problem is to ask four questions.
First:
What am I trying to estimate?
This determines the hidden state ().
For the drone example, we may want to estimate both position and velocity:
Even if we only measure position, velocity is still useful because it helps us predict future position.
Second:
How does the state evolve from one time step to the next?
This determines the transition model.
For a simple constant-velocity model, position changes according to velocity. If the time step is (), then:
and velocity may stay approximately the same:
In matrix form, this becomes:
where (A) is the state-transition matrix and () is process noise.
For this constant-velocity example, the transition matrix is:
This matrix says:
- new position equals old position plus velocity times time,
- new velocity equals old velocity.
Third:
What do I actually observe?
This determines the observation model.
If the sensor only measures position, then the observation is:
In matrix form:
where (C) selects the part of the hidden state that the sensor can observe.
For position-only measurements,
This means:
observe position, but do not directly observe velocity.
Fourth:
How noisy are the model and the measurements?
This determines the covariance matrices.
The process-noise covariance (Q) describes uncertainty in the dynamics. It answers:
How much do I trust my motion model?
The measurement-noise covariance (R) describes uncertainty in the sensor. It answers:
How much do I trust my observations?
If (R) is large, the measurements are noisy, so the filter trusts the model more.
If (R) is small, the measurements are reliable, so the filter trusts the observations more.
If (Q) is large, the model dynamics are uncertain, so the filter is more willing to adjust when new measurements arrive.
If (Q) is small, the model is trusted more strongly.
NOTE: Choosing (Q) and (R) is one of the most important practical parts of using a Kalman filter. The equations may be correct, but poor noise assumptions can make the filter behave badly.
What Is Required?
To run a Kalman filter, we need five main ingredients.
- An initial state estimate.
This is our best guess of the starting state.
- An initial uncertainty estimate.
This says how uncertain we are about the initial state.
- A transition model.
This describes how the state evolves.
- An observation model.
This describes how the hidden state produces measurements.
- Noise covariances.
The matrix (Q) describes process noise.
The matrix (R) describes measurement noise.
Once these are specified, the Kalman filter can run recursively.
How the Solution Proceeds
At each time step, the Kalman filter performs two operations: prediction and update.
The prediction step asks:
Before seeing the new measurement, where do I expect the state to be?
The predicted mean is:
The predicted covariance is:
The update step asks:
After seeing the new measurement, how should I revise my belief?
First, compute the innovation:
The innovation is the difference between what we observed and what the model expected us to observe.
Then compute the innovation covariance:
This describes how uncertain we are about the innovation.
Then compute the Kalman gain:
The Kalman gain determines how strongly the new measurement should change the estimate.
Finally, update the mean and covariance:
Then the filter moves to the next time step and repeats the same process.
The Practical Recipe
So the practical recipe is:
- Define the hidden state.
- Define how the state evolves.
- Define what the sensor observes.
- Estimate the process noise (Q).
- Estimate the measurement noise (R).
- Initialize the state mean and covariance.
- Repeat prediction and update as new measurements arrive.
This is why the Kalman filter is so useful.
Once the problem is written as a state-space model, the filtering procedure is automatic.
The real modeling work is deciding what belongs in the state, how the state evolves, what the observations measure, and how much uncertainty belongs in the model and the sensor.






























