Post · 3 min read· pp. 167–169

Kalman Filter Equations - Summary

We have derived all five Kalman Filter equations in matrix notation. Let us put them all together on a single page.

The Kalman Filter operates in a “predict-correct” loop, as shown in the diagram below.

Predict-Update Diagram

Once initialized, the Kalman Filter predicts the system state at the next step. It also provides the uncertainty of the prediction.

Once the measurement is received, the Kalman Filter updates (or corrects) the prediction and the uncertainty of the current state. As well the Kalman Filter predicts the following states, and so on.

The following diagram provides a complete picture of the Kalman Filter operation.

The Kalman Filter Diagram

The following table describes all Kalman Filter Equations.

EquationEquation NameAlternative names
Predictx^n+1,n=Fx^n,n+Gun\boldsymbol{\hat{x}}_{n+1,n} = \boldsymbol{F\hat{x}}_{n,n} + \boldsymbol{Gu}_{n}State ExtrapolationPredictor Equation Transition Equation Prediction Equation Dynamic Model State Space Model
Pn+1,n=FPn,nFT+Q\boldsymbol{P}_{n+1,n} = \boldsymbol{FP}_{n,n}\boldsymbol{F}^{T} + \boldsymbol{Q}Covariance ExtrapolationPredictor Covariance Equation
Update (correction)x^n,n=x^n,n−1+Kn(zn−Hx^n,n−1)\boldsymbol{\hat{x}}_{n,n} = \boldsymbol{\hat{x}}_{n,n-1} + \boldsymbol{K}_{n} (\boldsymbol{z}_{n} - \boldsymbol{H\hat{x}}_{n,n-1} )State UpdateFiltering Equation
Pn,n=(I−KnH)Pn,n−1(I−KnH)T+KnRnKnT\boldsymbol{P}_{n,n} = \left(\boldsymbol{I} - \boldsymbol{K}_{n}\boldsymbol{H} \right) \boldsymbol{P}_{n,n-1} \left(\boldsymbol{I} - \boldsymbol{K}_{n}\boldsymbol{H} \right)^{T} + \boldsymbol{K}_{n}\boldsymbol{R}_{n}\boldsymbol{K}_{n}^{T}Covariance UpdateCorrector Equation
Kn=Pn,n−1HT(HPn,n−1HT+Rn)−1\boldsymbol{K}_{n} = \boldsymbol{P}_{n,n-1}\boldsymbol{H}^{T}\left(\boldsymbol{HP}_{n,n-1}\boldsymbol{H}^{T} + \boldsymbol{R}_{n} \right)^{-1}Kalman GainWeight Equation
Auxiliaryzn=Hxn\boldsymbol{z}_{n} = \boldsymbol{Hx}_{n}Measurement Equation
Rn=E(vnvnT)\boldsymbol{R}_{n} = E\left( \boldsymbol{v}_{n}\boldsymbol{v}_{n}^{T} \right)Measurement CovarianceMeasurement Error
Qn=E(wnwnT)\boldsymbol{Q}_{n} = E\left( \boldsymbol{w}_{n}\boldsymbol{w}_{n}^{T} \right)Process Noise CovarianceProcess Noise Error
Pn,n=E(enenT)=E((xn−x^n,n)(xn−x^n,n)T)\boldsymbol{P}_{n,n} = E\left( \boldsymbol{e}_{n}\boldsymbol{e}_{n}^{T} \right) = E\left( \left( \boldsymbol{x}_{n} - \boldsymbol{\hat{x}}_{n,n} \right) \left( \boldsymbol{x}_{n} - \boldsymbol{\hat{x}}_{n,n} \right)^{T} \right)Estimation CovarianceEstimation Error

The following table summarizes notation (including differences found in the literature) and dimensions.

TermNameAlternative termDimensions
x\boldsymbol{x}State Vectornx×1n_{x} \times 1
z\boldsymbol{z}Measurements Vectory\boldsymbol{y}nz×1n_{z} \times 1
F\boldsymbol{F}State Transition MatrixΦ,A\boldsymbol{\Phi,A}nx×nxn_{x} \times n_{x}
u\boldsymbol{u}Input Variablenu×1n_{u} \times 1
G\boldsymbol{G}Control MatrixB\boldsymbol{B}nx×nun_{x} \times n_{u}
P\boldsymbol{P}Estimate CovarianceΣ\boldsymbol{\Sigma}nx×nxn_{x} \times n_{x}
Q\boldsymbol{Q}Process Noise Covariancenx×nxn_{x} \times n_{x}
R\boldsymbol{R}Measurement Covariancenz×nzn_{z} \times n_{z}
w\boldsymbol{w}Process Noise Vectory\boldsymbol{y}nx×1n_{x} \times 1
v\boldsymbol{v}Measurement Noise Vectornz×1n_{z} \times 1
H\boldsymbol{H}Observation MatrixC\boldsymbol{C}nz×nxn_{z} \times n_{x}
K\boldsymbol{K}Kalman Gainnx×nzn_{x} \times n_{z}
n\boldsymbol{n}Discrete-Time Indexk\boldsymbol{k}

Dimensions notation:

  • nxn_{x} is a number of states in a state vector
  • nzn_{z} is a number of measured states
  • nun_{u} is a number of elements of the input variable