control//state estimation//Kalman filter//covariance propagation

Covariance propagation is what lets a Kalman filter correct a quantity no sensor measures. A car tracked by GPS gets position readings only, and yet its filter ends up with a good velocity; covariance propagation is the step that makes that possible. Every time the filter predicts, it carries forward not only its estimate but how sure it is about each quantity and how their errors are tied together.


Covariance propagation is what lets a Kalman filter correct a quantity no sensor measures. A car tracked by GPS gets position readings only, and yet its filter ends up with a good velocity; covariance propagation is the step that makes that possible. Every time the filter predicts, it carries forward not only its estimate but how sure it is about each quantity and how their errors are tied together.

The intuition first. The filter predicts 100 m, the GPS says 103; it predicts 110, the GPS says 114; it predicts 120, the GPS says 125. The position error keeps growing by about one metre a step, and the only thing that explains a growing position error is a velocity that is too low. So a position reading corrects the velocity, through the model pk+1=pk+vkΔtp_{k+1}=p_k+v_k\Delta tpk+1​=pk​+vk​Δt. The filter knows to do this because it has tracked that its position and velocity errors move together, and that is all covariance means: when one is off, the other tends to be off too, in a known direction.

That bookkeeping is P\ca{P}P, a covariance matrix: on the diagonal, the uncertainty of each quantity; off the diagonal, whether being wrong about one means being wrong about the other, and in which direction. The prediction carries it forward as P−=FPFT+Q\cb{P^-}=\cd{F}\ca{P}\cd{F}^{\mathsf T}+\cd{Q}P−=FPFT+Q (F\cd{F}F on both sides because variance is quadratic, the matrix version of Var⁡(aX)=a2Var⁡(X)\operatorname{Var}(aX)=a^2\operatorname{Var}(X)Var(aX)=a2Var(X)). Before the reading in blue, after it in green, what the sensor brings in copper, the model in violet. For the car with Δt=1\Delta t=1Δt=1 and P=diag⁡(4,1)\ca{P}=\operatorname{diag}(4,1)P=diag(4,1),

FPFT=[1101][4001][1011]=[5111].\cd{F}\ca{P}\cd{F}^{\mathsf T}=\begin{bmatrix}1&1\\0&1\end{bmatrix}\begin{bmatrix}4&0\\0&1\end{bmatrix}\begin{bmatrix}1&0\\1&1\end{bmatrix}=\begin{bmatrix}5&1\\1&1\end{bmatrix}.FPFT=[10​11​][40​01​][11​01​]=[51​11​].

It started without correlation and the physics created one, the 1 off the diagonal: if the velocity is higher than the filter thinks, the car is also further ahead than it thinks. In the figure, P\ca{P}P is drawn as an ellipse. Press Predict and watch it stretch and tilt (that tilt is the correlation); press Measure position and watch the GPS squeeze it along position, and the velocity shrink with it.

σ position1.49 m σ velocity0.94 m/s ρ0.32 Starting from P = [[4.00, 0.00], [0.00, 1.00]], one prediction with dt = 1 s tilts the error ellipse to P⁻ = [[5.00, 1.00], [1.00, 1.00]]; one GPS fix with σ 2 m gives K = [0.556, 0.111] and P = [[2.22, 0.44], [0.44, 0.89]].

With a GPS of R=4\cc{R}=4R=4 that sees only position (H=[1  0]H=[1;0]H=[10]), the expected disagreement is S=5+4=9S=5+4=9S=5+4=9 and the gain K=19[5,1]T≈[0.556,0.111]TK=\tfrac19[5,1]^{\mathsf T}\approx[0.556,0.111]^{\mathsf T}K=91​[5,1]T≈[0.556,0.111]T: a 4 m disagreement moves the position by 2.22 m and the velocity by 0.44 m/s, and the velocity's variance falls from 1 to 0.89. The second entry of KKK exists only because of the off-diagonal term.

The axes of the ellipse are the eigenvectors of P\ca{P}P, and the square root of each eigenvalue is the standard deviation along that axis. The long axis points where the filter is most lost, and the most useful next measurement is the one that shortens it. A direction of P\ca{P}P that never shrinks, however many readings arrive, is a combination no sensor can see (controllability and observability).