control//state estimation//Kalman filter//adaptive Kalman filter

An adaptive Kalman filter estimates its own noise levels while it runs, for sensors whose precision changes with the conditions and for models whose doubt nobody could measure. A Kalman filter is handed \(\cc{R}\) and \(\cd{Q}\) once and believes them forever; a GPS that is excellent in open country and poor between buildings, or a drone whose model is good in calm air and bad in gusts, makes any fixed choice wrong half the time. What the sensor brings in copper, the model in violet, the uncertainty before the reading in blue.


An adaptive Kalman filter estimates its own noise levels while it runs, for sensors whose precision changes with the conditions and for models whose doubt nobody could measure. A Kalman filter is handed R\cc{R}R and Q\cd{Q}Q once and believes them forever; a GPS that is excellent in open country and poor between buildings, or a drone whose model is good in calm air and bad in gusts, makes any fixed choice wrong half the time. What the sensor brings in copper, the model in violet, the uncertainty before the reading in blue.

The information to correct them is already in the filter's own surprises. Over a window of recent steps, the observed spread of the innovation should match the spread S=HP−HT+RS=H\cb{P^-}H^{\mathsf T}+\cc{R}S=HP−HT+R the filter predicted. If the innovations are consistently larger than predicted, some noise is underestimated; if smaller, overestimated. The usual recipe estimates the innovation covariance by averaging ykykTy_ky_k^{\mathsf T}yk​ykT​ over the last NNN steps, subtracts the part the filter accounts for, and takes the rest as the current R\cc{R}R (the same reasoning, written differently, gives Q\cd{Q}Q).

The window is the tuning knob. A short window follows changes quickly but makes R\cc{R}R itself noisy; a long one is smooth but late, and it is chosen like any other filter constant.

R\cc{R}R and Q\cd{Q}Q are hard to tell apart from the innovations alone. A larger surprise can mean a worse sensor or a worse model, and estimating both at once from one sensor is often unobservable; practical designs adapt one and fix the other, or bound both.

A sensor that reports its own precision comes first. A GNSS receiver states its current accuracy from the satellite geometry, which is a better Rk\cc{R_k}Rk​ than any average of past innovations (measurement noise).

Adapting to outliers is a mistake. A single huge innovation inflates the window's estimate and makes the filter deaf for NNN steps; outliers are removed first (innovation gating) and only the remaining innovations feed the adaptation.