← All notes

Unscented Transform

Unscented Transform

Given x∼N(μ,P)x\sim\mathcal N(\mu, P) in nn dimensions and a non-linear y=f(x)y = f(x), estimate the mean and covariance of yy.

Recipe

  1. Choose sigma points — a small deterministic set with the same mean and covariance as xx.
  2. Propagate each one through ff (the real non-linear function, no linearisation).
  3. Recombine with weights to get yˉ\bar y and PyP_y (and the cross-covariance PxyP_{xy} if needed).

Sigma points

Let SS be any matrix square root, SST=(n+λ)PSS^T = (n+\lambda)P, with columns SiS_i:

χ0=μ,χi=μ+Si,χi+n=μ−Si(i=1…n)\chi_0 = \mu,\qquad \chi_i = \mu + S_i,\qquad \chi_{i+n} = \mu - S_i \qquad (i = 1\ldots n)
W0=λn+λ,Wi=12(n+λ)W_0 = \frac{\lambda}{n+\lambda},\qquad W_i = \frac{1}{2(n+\lambda)}
Recombine:
yˉ=∑iWi f(χi),Py=∑iWi (yi−yˉ)(yi−yˉ)T,Pxy=∑iWi (χi−μ)(yi−yˉ)T\bar y = \sum_i W_i\, f(\chi_i),\qquad P_y = \sum_i W_i\,(y_i-\bar y)(y_i-\bar y)^T,\qquad P_{xy} = \sum_i W_i\,(\chi_i-\mu)(y_i-\bar y)^T
The mean and covariance come out correct to 2nd order of the Taylor expansion (EKF: 1st order).

Kraft's version (this project)

λ=0\lambda = 0 → no centre point, 2n points with equal weights 12n\frac1{2n}. For n=6n = 6: 12 sigma points.

Spread factor

With equal weights the sample covariance of the points is 12n∑WiWiT=SST/n\frac{1}{2n}\sum W_iW_i^T = SS^T/n. To reproduce PP you need SST=nPSS^T = nP:

Option SS Points represent Where it comes from
standard chol⁡(nP)\operatorname{chol}(nP) PP ✅ unscented transform with κ = 0
kraft chol⁡(2nP)\operatorname{chol}(2nP) 2P2P as printed in Kraft (2003)
legacy sqrtm⁡(n P)\operatorname{sqrtm}(\sqrt n\,P) P/n≈0.41PP/\sqrt n \approx 0.41P original estimate_rot.py

Verified numerically in ukf_core (kraft → exactly 2.000 × P, legacy → 0.408 × P). → bug #3

Scaled UT (for reference)

Wan & van der Merwe parameterise with α\alpha (spread, ~1e-3…1), β\beta (prior knowledge, 2 for Gaussian), κ\kappa (often 0 or 3−n):

λ=α2(n+κ)−n,W0(m)=λn+λ,W0(c)=W0(m)+1−α2+β\lambda = \alpha^2(n+\kappa) - n,\qquad W_0^{(m)} = \frac{\lambda}{n+\lambda},\qquad W_0^{(c)} = W_0^{(m)} + 1 - \alpha^2 + \beta
Small α keeps points local (good for strongly non-linear functions); with small α, W0W_0 becomes large and negative.

Picture

flowchart LR
  G["Gaussian N(μ, P)"] --> S["2n sigma points<br/>μ ± columns of √(nP)"]
  S --> F["f(·) applied to each point"]
  F --> R["weighted mean & covariance"]
  R --> Y["≈ N(ȳ, P_y)"]

Next: Unscented Kalman Filter

Connections