Skip to main content
Contents4 / 6 ▾
IV

Chapter four The UKF: do not differentiate, sample

Julier and Uhlmann began from an observation that sounds almost too simple: it is easier to approximate a probability distribution than to approximate an arbitrary nonlinear function. So do not linearise the function at all. Instead choose a small, deliberate set of points that carry the mean and covariance exactly, push each one through the real nonlinear function, and fit a Gaussian to wherever they land.

This is the unscented transform, and the UKF is what you get when you use it in place of the Jacobians in Chapter III.

4.1 · Choosing the sigma points

For an \(n\)-dimensional state you need \(2n+1\) points. One sits at the mean; the rest are placed symmetrically along the principal axes of the covariance, at a distance set by a scaling parameter:

\[ \mathcal{X}^{(0)} = \hat{x}, \qquad \mathcal{X}^{(i)} = \hat{x} \pm \left( \sqrt{(n+\lambda)P} \right)_i, \quad i = 1 \dots n \]
(4.1)

where \(\lambda = \alpha^2(n+\kappa) - n\) controls the spread. Typical settings are \(\alpha \approx 10^{-3}\), \(\kappa = 0\), and \(\beta = 2\) which is optimal when the true distribution really is Gaussian. Each point carries two weights, one for reconstructing the mean and one for the covariance:

\[ W_m^{(0)} = \frac{\lambda}{n+\lambda}, \quad W_c^{(0)} = \frac{\lambda}{n+\lambda} + (1 - \alpha^2 + \beta), \quad W_m^{(i)} = W_c^{(i)} = \frac{1}{2(n+\lambda)} \]
(4.2)

4.2 · Propagate and recombine

Push every point through the true function — no derivatives anywhere — then take the weighted mean and weighted scatter of the results:

\[ \mathcal{Y}^{(i)} = f\!\left(\mathcal{X}^{(i)}\right), \qquad \hat{x}^- = \sum_{i=0}^{2n} W_m^{(i)} \mathcal{Y}^{(i)} \]
(4.3)
\[ P^- = \sum_{i=0}^{2n} W_c^{(i)} \left( \mathcal{Y}^{(i)} - \hat{x}^- \right)\left( \mathcal{Y}^{(i)} - \hat{x}^- \right)^\top + Q \]
(4.4)
P (input) 2n+1 sigma points f( · ) refitted Gaussian
Figure 4.1 — The unscented transform. Nothing is differentiated; the points themselves do the work. The output ellipse has rotated and stretched because the map was nonlinear — an EKF, transporting the covariance through a single tangent plane, cannot represent that as faithfully.

The measurement step is identical in spirit. Push the sigma points through \(h\), get \(\hat{z}^-\) and the innovation covariance \(P_{zz}\), and additionally form the cross-covariance between state and measurement:

\[ P_{xz} = \sum_{i=0}^{2n} W_c^{(i)} \left( \mathcal{X}^{(i)} - \hat{x}^- \right)\left( \mathcal{Z}^{(i)} - \hat{z}^- \right)^\top, \qquad K = P_{xz}\,P_{zz}^{-1} \]
(4.5)

Compare (4.5) with the EKF's \(K = P^-H^\top S^{-1}\). They are the same formula: \(P^-H^\top\) is the linear estimate of the cross-covariance. The UKF simply computes it by sampling instead of by differentiating.

Accuracy claim For a Gaussian input the unscented transform captures the true posterior mean and covariance correctly to third order in the Taylor expansion, whereas the EKF is correct only to first order in the mean and second order in the covariance. It buys this for roughly \(2n+1\) evaluations of \(f\) instead of one, and no Jacobians at all.

The catch is that the UKF is still a filter. It still assumes the posterior is Gaussian, it still processes measurements once and forgets them, and it still cannot go back and revise a state it committed to ten seconds ago. For that you need to abandon filtering altogether.

15