Introduction

The plain Kalman filter is a beautiful piece of engineering, but it comes with a catch: it assumes the world moves in straight lines. Position drifts linearly, velocity adds linearly, everything is a tidy matrix multiplication. Radars, robots and rockets rarely cooperate — they turn, they accelerate, they orbit, they bend.

The classic fix is the Extended Kalman Filter (EKF): at every step, draw a tangent line (or plane) against the curvy model and pretend that's the truth for one instant. It works — until the curve bends too sharply between two updates, and the tangent line quietly starts drifting from reality.

The Unscented Kalman Filter (UKF), introduced by Simon Julier and Jeffrey Uhlmann in 1997, throws out the tangent line entirely. Instead of approximating the function, it approximates the distribution — with a handful of carefully chosen points that go straight through the real, nonlinear model.

Try It

Below, a hidden object flies along a curved, noisy path (think a turning radar target). Two trackers try to follow it from noisy angle-and-range readings alone: a linearizing EKF and a sigma-point UKF.

<p class="hint">{{hint_para}}</p>
<canvas id="scene" width="460" height="300"></canvas>
<div class="status" id="status">{{status_ready}}</div>
<div class="legend">
  <span><i class="dot truth"></i>{{legend_truth}}</span>
  <span><i class="dot ekf"></i>{{legend_ekf}}</span>
  <span><i class="dot ukf"></i>{{legend_ukf}}</span>
  <span><i class="dot sigma"></i>{{legend_sigma}}</span>
</div>
<div class="btns">
  <button id="step" type="button">{{btn_step}}</button>
  <button id="run" type="button">{{btn_run}}</button>
  <button id="reset" type="button" class="ghost">{{btn_reset}}</button>
</div>
* { box-sizing: border-box; }
body { font-family: system-ui, sans-serif; color: #222; margin: 0; }
.hint { font-size: .9rem; color: #444; margin: 0 0 .6rem; line-height: 1.45; }
canvas { width: 100%; max-width: 460px; height: auto; background: #f4f6f8; border: 1px solid #d5dce2;
         border-radius: 8px; display: block; }
.status { font-size: .95rem; font-weight: 600; margin: .55rem 0 .3rem; min-height: 1.4em; color: #1d3557; }
.legend { display: flex; gap: .9rem; flex-wrap: wrap; font-size: .8rem; color: #444; margin-bottom: .5rem; }
.legend span { display: flex; align-items: center; gap: .35rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.truth { background: #2a9d4a; }
.dot.ekf { background: #e07b39; }
.dot.ukf { background: #1d3557; }
.dot.sigma { background: #9fb2c8; }
.btns { display: flex; gap: .5rem; flex-wrap: wrap; }
button { font: 600 14px system-ui, sans-serif; padding: .45rem .9rem; border: 1px solid #1d3557;
         background: #1d3557; color: #fff; border-radius: 8px; cursor: pointer; }
button.ghost { background: #fff; color: #1d3557; }
button:disabled { opacity: .5; cursor: default; }
// Code not found

Press Step to advance the simulation one measurement at a time, or Run to play it continuously. Watch the small dots — those are the UKF's sigma points — spread out, get pushed through the true nonlinear sensor model, and re-collapse into a mean and covariance every step. The tracking-error readout shows the UKF consistently closer to the truth, especially in the sharpest turns where the EKF's tangent-line approximation lags behind.

The Real Idea

The EKF's weakness is precise: it linearizes the model by computing a Jacobian — the matrix of partial derivatives — and applies it to the covariance as if the function were linear over that step. This is accurate to first order and can be expensive or brittle to differentiate for a nasty nonlinear model. Worse, first order simply throws away curvature.

The UKF sidesteps derivatives altogether with the unscented transform:

  • Pick sigma points. From a state of dimension nn with mean x^\hat{x} and covariance PP, build 2n+12n+1 points: the mean itself, plus nn points at x^+((n+λ)P)i\hat{x} + \left(\sqrt{(n+\lambda)P}\right)_i and nn points at x^((n+λ)P)i\hat{x} - \left(\sqrt{(n+\lambda)P}\right)_i, where λ\lambda is a small tuning constant and the square root is a matrix (Cholesky) square root.
  • Push them through the real function. Each sigma point is passed through the actual nonlinear transition or measurement function f(x)f(x) — no derivatives, no approximation of ff itself.
  • Recombine with fixed weights. The transformed mean and covariance are reconstructed as weighted sums: y^iwi(m)f(xi)\hat{y} \approx \sum_i w_i^{(m)} f(x_i) and Pyiwi(c)(f(xi)y^)(f(xi)y^)TP_y \approx \sum_i w_i^{(c)} \left(f(x_i)-\hat{y}\right)\left(f(x_i)-\hat{y}\right)^{\mathsf{T}}.

The payoff: this construction is accurate to the second order of the Taylor expansion for any nonlinearity (third order for Gaussian inputs), versus only first order for the EKF — while costing roughly the same handful of function evaluations, no Jacobian in sight. It is not a free lunch — the sigma points can still misrepresent a wildly multimodal or discontinuous distribution — but for smoothly curving systems it is a strictly better trade than linearizing.

Where It Matters

Anywhere a system's dynamics or sensors are nonlinear enough that a tangent line stops being a fair approximation, the UKF tends to show up:

  • Aerospace and robotics: spacecraft attitude estimation, quadrotor state estimation and SLAM (simultaneous localization and mapping) all wrestle with rotations and bearings-only sensors that are deeply nonlinear.
  • Sensor fusion: fusing GPS, IMU and radar/lidar readings, where the measurement model (range and bearing from Cartesian position) is nonlinear by nature.
  • Battery and process monitoring: estimating a battery's state of charge or a chemical reactor's internal state from indirect, nonlinearly related measurements.
  • Finance and epidemiology: any state-space model whose dynamics are multiplicative or saturating rather than additive benefits from sigma-point propagation over linearization.

It sits alongside the particle filter as one of the two standard escapes from the EKF's straight-line assumption — cheaper than particles, more faithful than a Jacobian.

Conclusion

The Unscented Kalman Filter is a small idea with an outsized payoff: instead of approximating a nonlinear function with its tangent, approximate the distribution going into it with a few deterministic points, and let the real function do the work. No Jacobians, better accuracy, roughly the same cost.

It is a reminder that the "hard" part of nonlinear estimation was never the arithmetic — it was insisting on a straight line where the world had a curve. Sample the curve instead, and the Kalman filter's elegant bookkeeping keeps working almost unchanged.

Share this article

Pick a channel — or use your device's native share sheet.

Comments

Loading comments...

https://www.kipuhub.com/en/article/unscented-kalman-filter/Content licensed under CC BY-NC 4.0.