What is the Kalman Filter?
Suppose you are in a car: your GPS tells you where you are positioned and is inaccurate and your speedometer tells you how fast you are going and is inaccurate. Kalman Filter is a mathematical technique in which several noisy inputs are integrated so as to present the most appropriate guess on the status of a system (such as location or speed).
The core idea of the Kalman Filter is as following:
It is a recursive algorithm that is computationally and offers optimal estimates to linear systems with Gaussian noise.
How Does the Kalman Filter Work?
Kalman Filter works in two stages which are the prediction stage and the update stage. This is the simplified mathematical explanation of it:
Prediction Phase
Based on the system model predict the current state:
x̂ₖ⁻ = F x̂ₖ₋₁ + B uₖ
Predicted Covariance:
Pₖ⁻ = F Pₖ₋₁ Fᵀ + Q
Where:
- x̂ₖ⁻: Prior state estimate
- F: State transition matrix
- uₖ: Control input
- Pₖ⁻: Prior estimate covariance
- Q: Process noise covariance
Update Phase
Put a value on the estimate with the measurements:
Kₖ = Pₖ⁻ Hᵀ (H Pₖ⁻ Hᵀ + R)⁻¹
Updated State:
x̂ₖ = x̂ₖ⁻ + Kₖ (zₖ – H x̂ₖ⁻)
Updated Covariance:
Pₖ = (I – Kₖ H) Pₖ⁻
Where:
- Kₖ: Kalman Gain
- R: Measurement noise covariance
- zₖ: Actual measurement
- H: Observation matrix
Simplified understanding: the process of finding K is the process of multiplying two Gaussian distributions to obtain a new Gaussian distribution.
The clever bit of the Kalman Filter is the Kalman Gain which decides how strongly we should believe the prediction of the Kalman Filter and how strongly we should believe the measurement of the Kalman Filter. When measurements are trustworthy (low R), then the gain is high, which means that more weight is attached to the measurements. The prediction gets weighted by noise in measurement.
Real-World Applications
The Kalman Filter has transformed many areas through the accurate state estimation:
It finds use in guidance of rockets, satellites determination of orbit and determination of the position of the ISS. Gives accurate navigation in places where there are no signals of the GPS.
Kalman filter for sensor fusion, Combines camera and radar, lidar and GPS data to build an accurate map of the environment around a vehicle to safely navigate.
Compares and analyses motion sensor data to count steps, orientation of the screen, and recognizing physical activity in the mobile device.
Noise filters in medical application like ECG and EEG monitoring equipment that enhance diagnostic quality of signals.
Kalman Filter vs. Traditional Methods
| Method | Advantages | Limitations | Best Use Cases |
|---|---|---|---|
| Kalman Filter | Processes in real time, optimal estimation, noise should be dealt effectively | Requires model of the system, more complex of calculation | Dynamical system state estimation |
| Moving Average | Easy to implement, Far less calculation; | Lag effect, poor in sudden fluctuation | Smoothing stable signals |
| Low-Pass Filter | Easy to implement in hardware, filters out the high frequencies noise | Phase delay, can remove useful signals | Stationary frequency noise removal |
| Particle Filter | Deals with non- linear systems, multi-modal distributions | Computational expensive, complicated implementation | works with highly non- linear systems |
Evolution of Kalman Filtering
Kalman filtering has taken a major evolution since Rudolf Kalman published the simplest of the algorithm in 1960:
Basic Kalman Filter
Linear systems optimal estimation
Extended Kalman Filter (EKF)
Linearizes non-linearity
Unscented Kalman Filter (UKF)
Makes non-linear systems use unscented transform
Particle Filter (PF)
Monte Carlo-based non-linear filtering
The Wisdom of Kalman Filtering
The Kalman Filter is giving us an important lesson about how to make decisions in an uncertain world: the world does not provide perfect information, but is it possible by combining predictions (based on our past experience) with observations (our current data) and by cleverly assigning weight to their reliability, we can make superior decisions.
Such a “predict-update” approach is not only useful in the engineering system but also in economics, finance and in daily life decision making.
