Tutorial 11: Unscented Kalman Filter (UKF)
This tutorial covers the Unscented Kalman Filter (UKF) for highly non-linear spacecraft tracking problems.
While EKFs approximate non-linearities using first-order Taylor series (Jacobians), the UKF uses the Unscented Transform to propagate the mean and covariance through non-linear functions directly using a deterministic set of Sigma Points.
1. Theory Prerequisite: Unscented Transform
Given a state \(x \sim \mathcal{N}(\hat{x}, P)\), we generate \(2n+1\) sigma points \(\mathcal{X}_i\):
\(\mathcal{X}_0 = \hat{x}\)
\(\mathcal{X}_i = \hat{x} + (\sqrt{(n+\lambda) P})_i\)
\(\mathcal{X}_{i+n} = \hat{x} - (\sqrt{(n+\lambda) P})_i\)
Where \(\lambda\) is a scaling parameter. These points are propagated through the non-linear function \(f(x)\) or \(h(x)\).
Advantage over EKF
No Jacobians required: Extremely useful for complex/discrete functions.
Higher accuracy: Captures mean and covariance to the 2nd order of Taylor series (EKF is 1st order).
Stable Square-Root (SR-UKF): Maintains is the Cholesky factor \(S\) of \(P\) (\(P = S S^T\)) ensuring positive-definiteness throughout execution.
import numpy as np
import matplotlib.pyplot as plt
from opengnc.kalman_filters.ukf import UKF
np.random.seed(42)
print("Imports successful.")
Imports successful.