05. Unscented Kalman Filter (UKF): The Unscented Transform and Algorithm

05. Unscented Kalman Filter (UKF): The Unscented Transform and Algorithm

The unscented Kalman filter approximates the transformed mean and covariance by evaluating a nonlinear function at representative points. Unlike the EKF, it does not require a first-order Jacobian. Better performance is possible on some nonlinear problems but not guaranteed.

The unscented transform

Illustration of a distribution mapped through a nonlinear transform
Representative points are passed through the nonlinear mapping.

The original article uses a symmetric spherical–radial rule with \(2n\) equally weighted points. It is one sigma-point construction, not the definition of every UKF. A scaled unscented transform often uses \(2n+1\) points and different weights.

Given a mean \(\mu\) and covariance \(P=LL^\mathsf T\), take the columns \(Le_i\) of a matrix square root:

\[\chi_i^\pm=\mu\pm\sqrt n\,Le_i,\qquad w_i=\frac1{2n},\quad i=1,\ldots,n.\]

These points reproduce the input mean and covariance. For a nonlinear mapping \(g\), evaluate \(g(\chi_i)\) individually and use their weighted sample mean and outer products to approximate the output moments. A suitable covariance factorization is still needed; symmetry alone does not guarantee numerical stability.

1. Initialize

Set the initial posterior mean and covariance. The following recursion assumes additive process and measurement noise. Use a consistent treatment of nonadditive noise, for example an augmented state, if that assumption does not hold.

2. Predict

Generate sigma points from the previous posterior. Propagate them through \(f\) and use weights \(w_i\) to form the new moments:

\[\chi_i^*=f(\chi_i,u),\qquad \hat x^-=\sum_i w_i\chi_i^*,\qquad P^-=\sum_i w_i(\chi_i^*-\hat x^-)(\chi_i^*-\hat x^-)^\mathsf T+Q.\]

3. Update

Regenerate sigma points \(\chi_i^-\) from \((\hat x^-,P^-)\) so the predicted spread includes Q. Apply \(h\) to each point, obtaining \(z_i=h(\chi_i^-)\). Let \(\bar z=\sum_i w_i z_i\).

\[\begin{aligned} S &= \sum_i w_i(z_i-\bar z)(z_i-\bar z)^\mathsf T+R,\\ C &= \sum_i w_i(\chi_i^--\hat x^-)(z_i-\bar z)^\mathsf T,\\ K &= C S^{-1},\\ \hat x^+ &= \hat x^-+K(y-\bar z),\qquad P^+=P^--KSK^\mathsf T. \end{aligned}\]

Compare the UKF and EKF on the same measurements and noise model. Cost, numerical robustness, and accuracy all depend on the model and the sigma-point rule.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *