control//state estimation//Kalman filter//filter consistency

Filter consistency is the property of an estimator whose reported uncertainty matches the errors it actually makes, and checking it is the first test of any Kalman filter before its output is trusted for decisions. A filter reports its covariance \(\ca{P}\) next to its estimate, but that \(\ca{P}\) is computed from the \(\cd{Q}\) and \(\cc{R}\) someone chose (estimate covariance): it states what the designer believed about the model and the sensors, and whether that belief was true can only be decided with data. The estimate and its uncertainty after the reading in green, what the sensor brings in copper, the model in violet.


Filter consistency is the property of an estimator whose reported uncertainty matches the errors it actually makes, and checking it is the first test of any Kalman filter before its output is trusted for decisions. A filter reports its covariance P\ca{P}P next to its estimate, but that P\ca{P}P is computed from the Q\cd{Q}Q and R\cc{R}R someone chose (estimate covariance): it states what the designer believed about the model and the sensors, and whether that belief was true can only be decided with data. The estimate and its uncertainty after the reading in green, what the sensor brings in copper, the model in violet.

Two tests exist, depending on whether the truth is available. In simulation, or on a test run with a reference far better than the filter (an RTK GPS beside a drone's ordinary receiver), the real error is known and can be measured in units of the error the filter claimed:

NEESk=(xk−x^k)T Pk−1 (xk−x^k).\text{NEES}_k=(x_k-\ca{\hat x_k})^{\mathsf T}\,\ca{P_k}^{-1}\,(x_k-\ca{\hat x_k}).NEESk​=(xk​−x^k​)TPk​−1(xk​−x^k​).

For a consistent filter this normalized estimation error squared follows a chi-square distribution with nnn degrees of freedom, one per state variable, and averages nnn. In operation there is no truth, and the only witness left is the innovation, because it contains real data: if model, Q\cd{Q}Q and R\cc{R}R are right, innovations have zero mean, carry no memory from step to step and have the covariance SSS the filter predicts. Their size is checked with the NIS.

The controller acts on the estimate, and the gates and alarms act on the uncertainty.

An optimistic P\ca{P}P turns a modest error into confident wrong decisions: gates that refuse good readings, alarms set too tight, a planner that trusts a position it should doubt. A filter with a slightly worse estimate and an honest band is the more useful one.

The shape of the innovations matters as much as their size. Runs of the same sign mean missing dynamics, an unmodelled bias or a Q\cd{Q}Q with the wrong shape, and show up in their autocorrelation (innovation whiteness); an innovation that is right on average and oscillates says the model's dynamics are wrong.

Optimism and pessimism cost different things. An optimistic filter is overconfident and drifts away inside a narrow band; a pessimistic one wastes information, which costs precision and is the safer of the two errors, and the reason a new filter starts slightly humble (process noise).

The most dangerous inconsistency is silent. A diverging extended Kalman filter shrinks P\ca{P}P while its error grows, so its band looks better at the moment the estimate is worst, and only the innovations betray it.

What is fixed once an inconsistency is found is first the model, then Q\cd{Q}Q and R\cc{R}R (filter tuning); the catalogue of causes is in Kalman filter limits.