﻿ Simplified Covariance Update Equation

# Simplified Covariance Update Equation

In many textbooks, you can find a simplified form of the Covariance Update Equation:

$\boldsymbol{P}_{n,n} = \left(\boldsymbol{I} - \boldsymbol{K}_{n}\boldsymbol{H} \right) \boldsymbol{P}_{n,n-1}$

To derive a simplified form of the Covariance Update Equation, plug the Kalman Gain Equation into the Covariance Update Equation.

Notes
$$\boldsymbol{P}_{n,n} = \boldsymbol{P}_{n,n-1} - \boldsymbol{P}_{n,n-1}\boldsymbol{H}^{T}\boldsymbol{K}_{n}^{T} - \boldsymbol{K}_{n}\boldsymbol{HP}_{n,n-1} + \\ + \color{#7030A0}{\boldsymbol{K}_{n}} \left(\boldsymbol{HP}_{n,n-1}\boldsymbol{H}^{T} + \boldsymbol{R}_{n} \right) \boldsymbol{K}_{n}^{T}$$ Covariance Update Equation after expansion
$$\boldsymbol{P}_{n,n} = \boldsymbol{P}_{n,n-1} - \boldsymbol{P}_{n,n-1}\boldsymbol{H}^{T}\boldsymbol{K}_{n}^{T} - \boldsymbol{K}_{n}\boldsymbol{HP}_{n,n-1} + \\ + \color{#7030A0}{ \boldsymbol{P}_{n,n-1}\boldsymbol{H}^{T}\left(\boldsymbol{HP}_{n,n-1}\boldsymbol{H}^{T} + \boldsymbol{R}_{n} \right)^{-1} } \left(\boldsymbol{HP}_{n,n-1}\boldsymbol{H}^{T} + \boldsymbol{R}_{n} \right) \boldsymbol{K}_{n}^{T}$$ Substitute the Kalman Gain Equation
$$\boldsymbol{P}_{n,n} = \boldsymbol{P}_{n,n-1} - \boldsymbol{P}_{n,n-1}\boldsymbol{H}^{T}\boldsymbol{K}_{n}^{T} - \boldsymbol{K}_{n}\boldsymbol{HP}_{n,n-1} + \\ + \boldsymbol{P}_{n,n-1}H^{T} \boldsymbol{K}_{n}^{T}$$ $$\left(\boldsymbol{HP}_{n,n-1}\boldsymbol{H}^{T} + \boldsymbol{R}_{n} \right)^{-1} \times \\ \times \left(\boldsymbol{HP}_{n,n-1}\boldsymbol{H}^{T} + \boldsymbol{R}_{n} \right) = 1$$
$$\boldsymbol{P}_{n,n} = \boldsymbol{P}_{n,n-1} - \boldsymbol{K}_{n}\boldsymbol{HP}_{n,n-1}$$
$$\boldsymbol{P}_{n,n} = \left(\boldsymbol{I} - \boldsymbol{K}_{n}\boldsymbol{H} \right)\boldsymbol{P}_{n,n-1}$$
Warning! This equation is much more elegant and easier to remember and it performs well in many cases. However, a minor error in computing the Kalman Gain (due to round-off) can lead to huge computation errors. The subtraction $$(\boldsymbol{I} - \boldsymbol{K}_{n}\boldsymbol{H})$$ can lead to nonsymmetric matrices due to floating-point errors. This equation is numerically unstable!

For more details, see: “Bucy, R. S., and Joseph, P. D. (1968). Filtering for Stochastic Processes with Applications to Guidance. Interscience, New York”, Chapter 16, “Roundoff errors” section.