You have 3 free guides left 😟
Unlock your guides
You have 3 free guides left 😟
Unlock your guides

12.2 Kalman filter algorithm

2 min readjuly 22, 2024

The algorithm is a powerful tool for estimating the state of dynamic systems from noisy observations. It's used in various applications, from to , recursively predicting and updating state estimates based on previous data and new observations.

The algorithm combines prediction and updating steps to estimate system states, incorporating uncertainties through error covariance matrices. It balances trust between system models and observations, making it adaptable to different scenarios. Implementation involves defining models, initializing parameters, and iterating through time steps.

Kalman Filter Algorithm

Purpose of Kalman filter algorithm

Top images from around the web for Purpose of Kalman filter algorithm
Top images from around the web for Purpose of Kalman filter algorithm
  • Estimates state of dynamic system from noisy observations (GPS tracking, weather forecasting)
  • Recursively predicts state based on previous estimate and system model
  • Updates prediction by incorporating new observations to improve accuracy
  • Quantifies uncertainty in state estimates using error covariance matrices

Application for state estimation

  • Models system evolution over time using (FF) and (QQ)
    • State transition equation: xt=Fxt1+wtx_t = Fx_{t-1} + w_t, where wtN(0,Q)w_t \sim N(0, Q)
  • Relates system state to measurements using (HH) and (RR)
    • Observation equation: zt=Hxt+vtz_t = Hx_t + v_t, where vtN(0,R)v_t \sim N(0, R)
  • Performs to estimate state at current time based on previous estimate
    1. Predicted state estimate: x^tt1=Fx^t1t1\hat{x}_{t|t-1} = F\hat{x}_{t-1|t-1}
    2. Predicted error covariance: Ptt1=FPt1t1FT+QP_{t|t-1} = FP_{t-1|t-1}F^T + Q
  • Updates prediction by combining with new observations in
    1. : Kt=Ptt1HT(HPtt1HT+R)1K_t = P_{t|t-1}H^T(HP_{t|t-1}H^T + R)^{-1}
    2. Updated state estimate: x^tt=x^tt1+Kt(ztHx^tt1)\hat{x}_{t|t} = \hat{x}_{t|t-1} + K_t(z_t - H\hat{x}_{t|t-1})
    3. Updated error covariance: Ptt=(IKtH)Ptt1P_{t|t} = (I - K_tH)P_{t|t-1}

Prediction vs updating vs smoothing

  • Prediction estimates future state based on current estimate and system model (weather forecasting, stock price prediction)
  • Updating incorporates new observations to improve state estimate at current time (GPS navigation, sensor fusion)
    • Balances trust in system model and observations based on their uncertainties
  • Smoothing estimates past states using all available observations, including future ones (data analysis, signal processing)
    • Fixed-interval smoothing estimates states over fixed time interval
    • Fixed-lag smoothing estimates states fixed number of steps in past

Implementation in software

  • Select programming language or software (MATLAB, Python with NumPy/SciPy, R)
  • Define system and observation models by specifying FF, QQ, HH, and RR matrices
  • Initialize Kalman filter with initial state estimate (x^00\hat{x}_{0|0}) and error covariance (P00P_{0|0})
  • Implement prediction and update steps using Kalman filter equations
  • Iterate through time steps, performing prediction and update at each step
  • Store estimated states and error covariances for analysis or visualization
  • Validate implementation by testing on simulated or real data with known ground truth
    • Compare estimated states to true states to assess Kalman filter performance
© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.


© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.

© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.
Glossary
Glossary