Robust Kalman Filtering: Handling Outlier Measurements

Stochastic Processes · Hard · Free problem

The standard Kalman filter assumes Gaussian measurement noise. In practice -- especially in financial signal processing or sensor fusion -- you will occasionally see a reading that is wildly off: a data error, a flash crash tick, a sensor glitch. A single such outlier can drag your state estimate far from the truth and take many steps to recover.

Describe three distinct approaches to make a Kalman filter robust to outlier measurements. For each approach, explain the core idea, how it modifies the standard filter equations, and when you would choose it.

Hints

  1. The Kalman filter is a weighted average between model prediction and measurement -- think about how you would reduce the weight given to a suspicious observation.
  2. The normalized innovation $d_t^2 = y_t^T S_t^{-1} y_t$ follows a $\chi^2$ distribution under the Gaussian assumption -- this gives you a principled way to flag outliers.
  3. Consider three levers: (a) hard-threshold the innovation and inflate $R$, (b) change the noise distribution to a heavy-tailed family like Student-$t$, or (c) replace the quadratic loss with a bounded loss like Huber.

Worked Solution

How to Think About It: The Kalman filter is, at its heart, a weighted average between your prior (model prediction) and the new measurement. The weights are determined by the Kalman gain $K_t$, which is driven by relative confidence in the model vs. the sensor. An outlier is a measurement you should trust very little -- ideally not at all. So the three approaches differ in *how* they detect or model distrust and *how* they reduce the outlier's influence. Think of them on a spectrum from blunt (just gate it out) to principled (change your noise model entirely).

Key Insight: Every robust approach ultimately reduces the effective Kalman gain for suspicious measurements. The methods differ in how they decide what counts as suspicious and how aggressively they down-weight.

The Method:

Approach 1: Innovation Gating (Adaptive Measurement Covariance)

The *innovation* is the gap between what you expected and what you observed: $y_t = z_t - H\hat{x}_{t|t-1}$. Under normal conditions, the innovation should be consistent with the innovation covariance $S_t = H P_{t|t-1} H^T + R$. You can test this formally with the normalized squared innovation (Mahalanobis distance):

$$d_t^2 = y_t^T S_t^{-1} y_t$$

Under Gaussianity, $d_t^2 \sim \chi^2_n$ where $n$ is the measurement dimension. If $d_t^2$ exceeds a threshold (say, the 99th percentile of $\chi^2_n$), declare the measurement an outlier and inflate the measurement noise covariance for that step:

$$R_t^{\text{robust}} = \gamma \cdot R, \quad \gamma \gg 1$$

A large $R$ drives the Kalman gain $K_t = P_{t|t-1} H^T S_t^{-1}$ close to zero, so the outlier barely moves the estimate. In the limit $\gamma \to \infty$, you are simply skipping the measurement entirely.

Approach 2: Heavy-Tailed Measurement Model (Student-$t$ Filter)

Instead of binary gating, replace the Gaussian measurement noise assumption with a Student-$t$ distribution:

$$v_t \sim t_\nu(0, R)$$

The $t$ distribution has heavier tails than Gaussian -- large deviations are much more probable under this model, so they receive a softer penalty. The resulting filter is an iteratively reweighted Kalman update: each iteration solves for the update while assigning weight $w_t$ to each measurement, where

$$w_t \propto \frac{\nu + n}{\nu + d_t^2}$$

As $d_t^2$ grows (larger outlier), $w_t$ shrinks -- the filter automatically down-weights extreme measurements. As $\nu \to \infty$, $w_t \to 1$ and you recover the standard filter. A common practical choice is $\nu = 3$ to $5$, which is robust but still efficient for inliers.

Approach 3: Huber M-Estimation (Clipped Innovation)

The standard Kalman filter minimizes a quadratic cost in the innovations. Quadratic cost is the root of the problem: it assigns weight proportional to the size of the error, so large outliers dominate. Replace the quadratic with the Huber loss:

$$\rho(y) = \begin{cases} y^2/2 & |y| \leq c \\\ c|y| - c^2/2 & |y| > c \end{cases}$$

This is quadratic for small innovations and linear for large ones -- you stop penalizing (and therefore stop trusting) innovations beyond $\pm c$ standard deviations. The resulting update clips the innovation:

$$y_t^{\text{clipped}} = \text{sign}(y_t) \cdot \min\!\left(|y_t|,\, c \cdot \sqrt{S_t}\right)$$

and uses $y_t^{\text{clipped}}$ in place of $y_t$ in the standard Kalman update. This bounds the influence of any single measurement regardless of how extreme it is.

Practical Considerations:

  • *Gating* (Approach 1) is the simplest to implement and most common in production. The threshold is typically set at $3\sigma$ to $5\sigma$ (equivalently, $d_t^2 > 9$ to $25$ for scalar measurements). The downside: it is binary -- measurements just inside the threshold get full weight, just outside get zero. It also permanently discards potentially valid tail observations.
  • *Student-$t$ filter* (Approach 2) is more principled and continuously down-weights rather than binary-gates. It requires iterating to convergence at each step, adding computational cost. Best when outliers are relatively frequent and you want a smoother transition between inlier and outlier treatment. Choosing $\nu$ can be done via EM or cross-validation.
  • *Huber M-estimation* (Approach 3) is a middle ground: it has a hard cap on influence (like gating) but applies it continuously (like the $t$ filter). The threshold $c$ has a cleaner interpretation than $\nu$, but the filter is an approximation and loses the clean Bayesian interpretation of the standard Kalman.
  • In financial applications, gating is dominant for high-frequency signal processing (straightforward, low latency). The Student-$t$ and Huber approaches appear more in state-space econometric models and factor model estimation.

Answer: Three approaches to robust Kalman filtering: (1) *Innovation gating* -- declare measurements beyond a $\chi^2$ threshold as outliers and inflate $R$ to zero out their Kalman gain; (2) *Student-$t$ measurement model* -- replace Gaussian noise with heavy-tailed noise so the filter naturally down-weights large innovations through iterative reweighting; (3) *Huber M-estimation* -- replace the quadratic innovation cost with the Huber loss, clipping extreme innovations at $\pm c$ standard deviations. Gating is the simplest and most common in practice; the other two are more statistically principled but add implementation complexity.

Intuition

The core vulnerability of the standard Kalman filter is that it treats all innovations as equally informative -- it simply scales their influence by the Kalman gain. That gain is computed assuming Gaussian noise, and Gaussian tails are thin: a $5\sigma$ observation is essentially impossible under the model. But in real data, $5\sigma$ events happen all the time due to model misspecification, data errors, or genuine fat tails. When one arrives, the filter chases it, and recovery takes many subsequent steps. All three robust approaches are ways of saying the same thing with different math: beyond some level of surprise, stop believing the measurement.

The deeper lesson is about the choice of loss function. Quadratic loss gives the optimal estimator under Gaussian assumptions, but it is maximally non-robust -- unbounded sensitivity to outliers. Heavy-tailed models and Huber loss are ways of building in the prior belief that extreme residuals are more likely to be noise than signal. This same trade-off appears everywhere in quantitative finance: in robust regression for factor models, in winsorization of return data, in trimmed-mean estimators. When your data is messy -- and financial data almost always is -- the optimal Gaussian estimator is often the worst practical choice.

Open the full interactive solver →