← All notes

Unscented Kalman Filter

Unscented Kalman Filter

Kalman filter structure + Unscented Transform for every non-linear step.

Model

xk=f(xk−1,uk)+wkzk=h(xk)+vkw∼N(0,Q), v∼N(0,R)x_k = f(x_{k-1}, u_k) + w_k \qquad z_k = h(x_k) + v_k \qquad w\sim\mathcal N(0,Q),\ v\sim\mathcal N(0,R)

Algorithm (additive noise)

Predict

  1. Sigma points from (x^k−1,Pk−1)(\hat x_{k-1}, P_{k-1}):  χi\ \chi_i
  2. Propagate:  Yi=f(χi)\ \mathcal Y_i = f(\chi_i)
  3. Prior:  xˉ=∑WiYi,Pˉ=∑Wi(Yi−xˉ)(⋅)T+Q\ \bar x = \sum W_i\mathcal Y_i,\quad \bar P = \sum W_i(\mathcal Y_i-\bar x)(\cdot)^T + Q

Update 4. Predicted measurements:  Zi=h(Yi),zˉ=∑WiZi\ \mathcal Z_i = h(\mathcal Y_i),\quad \bar z = \sum W_i\mathcal Z_i 5. Pzz=∑Wi(Zi−zˉ)(⋅)T,Pvv=Pzz+R,Pxz=∑Wi(Yi−xˉ)(Zi−zˉ)TP_{zz} = \sum W_i(\mathcal Z_i-\bar z)(\cdot)^T,\quad P_{vv} = P_{zz} + R,\quad P_{xz} = \sum W_i(\mathcal Y_i-\bar x)(\mathcal Z_i-\bar z)^T 6. K=PxzPvv−1K = P_{xz}P_{vv}^{-1} 7. x^=xˉ+K(z−zˉ),P=Pˉ−KPvvKT\hat x = \bar x + K(z-\bar z),\quad P = \bar P - KP_{vv}K^T

Compare with the linear KF: PxzP_{xz} plays the role of PˉHT\bar PH^T, and PvvP_{vv} that of SS.

Where does Q go?

  • Additive after propagation (above): Pˉ=…+Q\bar P = \ldots + Q.
  • Before the sigma points (Kraft, and this project): sigma points are drawn from P+QP + Q, so process noise is also pushed through ff. Slightly more accurate when noise enters non-linearly (orientation noise does).
  • Augmented state: add the noise to the state, n→n+nwn \to n + n_w, and draw sigma points over everything. Most general, most expensive.

Reusing sigma points

Here the update reuses the propagated points Yi\mathcal Y_i instead of redrawing from (xˉ,Pˉ)(\bar x, \bar P). Cheaper, and it keeps the higher-order information from the prediction. Redrawing is also valid.

UKF vs EKF

EKF UKF
Linearisation Jacobians at the mean sigma points through real functions
Accuracy 1st order 2nd order (mean and covariance)
Derivatives needed yes no
Cost ~1 evaluation of f, h 2n+1 evaluations
Manifold states (quaternions) error-state EKF needs ⊞/⊟ → Quaternion UKF (Kraft)

Next: Quaternion UKF (Kraft)

Connections