Interactive Visualization of Sigma Points and Nonlinear Transformations
The Unscented Kalman Filter uses sigma points to capture uncertainty through nonlinear transformations. Instead of linearizing (like the Extended Kalman Filter), the UKF samples carefully chosen points around the mean.
Try this: Drag the slider to change uncertainty, or select different functions to see how the UKF handles various nonlinearities. Notice how the red curve closely matches the yellow true transformation!
Starting with an initial state estimate and covariance. The UKF will predict the next state and then correct it based on measurements.
Unlike the Extended Kalman Filter (EKF) which linearizes using Jacobians, the UKF directly propagates uncertainty through nonlinear functions using sigma points. This gives better accuracy for highly nonlinear systems.
The UKF doesn't require derivatives! You just provide the nonlinear function
f(x), and the filter handles the rest. This makes implementation
easier and works with non-differentiable functions.
Sigma points are chosen to match the first two moments (mean and covariance) of the distribution. The UKF captures effects up to 3rd order (Taylor series), while EKF only captures 1st order.
The SR-UKF works with the Cholesky factor S where P = SS'.
This guarantees positive definiteness and provides better numerical stability
for long-running filters.
For n-dimensional state, we use 2n+1 sigma points.
They're placed at x̄ ± √((n+λ)P) along each principal axis,
plus one at the mean. Parameter λ controls the spread.
UKF requires 2n+1 function evaluations per iteration
(vs. 1 for EKF plus Jacobian computation). For small to medium n (<20),
this is very reasonable on modern hardware.
1. Sigma Point Generation:
χ₀ = x̄
χᵢ = x̄ + (√((n+λ)P))ᵢ for i = 1,...,n
χᵢ = x̄ - (√((n+λ)P))ᵢ₋ₙ for i = n+1,...,2n
2. Prediction (Process Model):
χᵢ⁻ = f(χᵢ) for all i
x̄⁻ = Σ Wᵢᵐ χᵢ⁻
P⁻ = Σ Wᵢᶜ (χᵢ⁻ - x̄⁻)(χᵢ⁻ - x̄⁻)' + Q
3. Update (Measurement Model):
Υᵢ = h(χᵢ⁻) for all i
ŷ = Σ Wᵢᵐ Υᵢ
K = Pₓᵧ (Pᵧᵧ + R)⁻¹
x̄⁺ = x̄⁻ + K(y - ŷ)
Where Wᵢᵐ and Wᵢᶜ are weights chosen to satisfy moment-matching conditions.