▲Wirig Diagram Hot
▲ ▲ ▼

Kalman Filter Formulas: Mastering Predictive Estimation

By

The Kalman filter, an algorithm developed by Rudolf E.K. Kalman, is a powerful tool for recursive filtering of noisy data. It's widely used in aviation, space engineering, and other fields for estimating the state of a dynamic system from incomplete and noisy measurements. Let's delve into the Kalman filter formulas to understand its workings.

At the heart of the Kalman filter lies a predictive and corrective process. It maintains an estimate of the system's state while minimizing the estimated error. The system's state can include any relevant variables like position, velocity, acceleration, etc.

The Kalman Filter Prediction Step

In the prediction step, the Kalman filter projects the current state estimate ahead, while also projecting the error covariance ahead.

an upward graph shows the price and volume of oil in different countries, as well as prices
an upward graph shows the price and volume of oil in different countries, as well as prices
Understanding Kalman Filters with Python
Understanding Kalman Filters with Python
How a Kalman filter works, in pictures
How a Kalman filter works, in pictures

The prediction step uses the system's state and error covariance from the previous step, along with the system's transition matrix and noise covariance, to calculate the predicted state and error covariance. This step is governed by the following formulas:

Predicted State

The predicted state (x̂ Predicted) is calculated as follows:

Kalman Filter: Technical Guide for Finance and Lead Scoring
Kalman Filter: Technical Guide for Finance and Lead Scoring
Kalman Filtering: An Intuitive Guide Based on Bayesian Approach | Towards Data Science
Kalman Filtering: An Intuitive Guide Based on Bayesian Approach | Towards Data Science
Portraits of Kalman Filters — Embedded
Portraits of Kalman Filters — Embedded
x̂ Predicted = Φx̂ Previous + Bības Previous

where,

  • Φ is the transition matrix that maps the previous state to the next.
  • B is the control-input matrix (not discussed here as we're focusing on the basic Kalman filter).
  • istiin the previous state estimate.
  • itación is the process noise with covariance Q.

Predicted Error Covariance

The predicted error covariance (P Predicted) is calculated as follows:

P Predicted = ΦP Previous Φ^T + Q

where,

  • Φ is the transition matrix (same as before).
  • P Previous is the error covariance from the previous step.
  • Q is the process noise covariance.
  • Φ^T is the transpose of the transition matrix.

The Kalman Filter Update Step

The update step compares the predicted state to the actual measurement, and adjusts the estimate accordingly. It results in an improved estimate.

This step uses the predicted state and error covariance, along with the measurement matrix, measurement noise covariance, and the actual measurement. The formulas for this step are:

Kalman Gain

The Kalman gain (K) is calculated as follows:

K = P Predicted H^T (H P Predicted H^T + R)^(-1)

where,

  • H is the measurement matrix that maps the state to the measurement.
  • R is the measurement noise covariance.

Updated State

The updated state (x̂ Updated) is calculated as follows:

x̂ Updated = x̂ Predicted + K(y - Hx̂ Predicted)

where,

  • y is the actual measurement.

Updated Error Covariance

The updated error covariance (P Updated) is calculated as follows:

P Updated = (I - KH) P Predicted

where,

  • I is the identity matrix.

The Kalman filter then uses the updated state and error covariance to start the next predictive cycle. This process repeats recursively, continually improving the state estimate as new measurements come in.

Understanding the Kalman filter formulas is key to implementing and tuning this powerful algorithm. However, the formulas alone don't tell the whole story. Effective use of the Kalman filter requires understanding the dynamics of the system being estimated, the characteristics of the noise, and the properties of the measurements.

Unscented Kalman Filter (UKF)
Unscented Kalman Filter (UKF)
Approximation of a 2D distribution by the Sigma-Point Kalman Filtering approach
Approximation of a 2D distribution by the Sigma-Point Kalman Filtering approach
Application of the Kalman filtering technique for nonlinear state estimation
Application of the Kalman filtering technique for nonlinear state estimation
All About Kalman Filters
All About Kalman Filters
The Mathematics of the Kalman Filter - Alan Zucconi
The Mathematics of the Kalman Filter - Alan Zucconi
Kalman Filter(3) - Localisation in Continuous State Space | Towards Data Science
Kalman Filter(3) - Localisation in Continuous State Space | Towards Data Science
An introduction to scalar Kalman filters
An introduction to scalar Kalman filters
Kalman Filters for Undergrads 1
Kalman Filters for Undergrads 1
Understanding Kalman Filters, Part 6: How to use Kalman Filters in Simulink
Understanding Kalman Filters, Part 6: How to use Kalman Filters in Simulink
💬 Comments ↗ Share ★ Save
AD