Sensor Fusion: Classical to Modern · Lesson 8 of 22

The Unscented Kalman Filter — Fusing Through Nonlinearity

The E-K-F draws a tangent line through a curved world and quietly lies. The U-K-F refuses to. Its trick is a beautiful flip: instead of approximating the curve, approximate the cloud of uncertainty — pick a few clever points, push them through the real nonlinearity, and read the answer off the warped result. No Jacobians, no tangent line, no quiet lie.

Prerequisites: the E-K-F (Lesson 7) + mean & variance. That's it.
11
Chapters
6
Simulations
0
Jacobians Required

Chapter 0: When the Tangent Line Quietly Lies

You are tracking a robot with a single distance sensor — a cheap beacon bolted to the wall that reports how far away the robot is, but not in which direction. The robot is somewhere out in front of it, and you have a fuzzy belief about where: roughly two meters away, give or take. You want to turn that "distance reading" into a guess about the robot's position. Simple, except for one cruel fact of geometry: distance is the square root of the sum of squared coordinates. The map from "where the robot is" to "what the sensor reads" is curved, not straight. And on a curve, the trick everyone reaches for first — drawing a straight tangent line and pretending the world is flat near it — goes wrong in a way that is hard to see and easy to ship.

That tangent-line trick is the Extended Kalman Filter (E-K-F), the workhorse from Lesson 7. When a sensor or a motion model is nonlinear, the E-K-F replaces the curve with a straight line tangent to it at your current best guess, then runs the ordinary Kalman math on that line. It is fast, it is famous, and on gentle curves it is wonderful. But on a sharp curve it commits a subtle crime: it reports the wrong center of your uncertainty. The estimate becomes biased — not just noisier, but systematically off in one direction — and a biased filter is far more dangerous than a merely noisy one, because no amount of averaging will save you. You are confidently wrong.

Common misconception. "Linearization error is just a little extra noise — the filter will average it out." It will not. The tangent-line approximation does not add zero-mean jitter; it shifts the mean of the transformed cloud away from where the true mean sits. That is a bias, and bias is the one error a filter cannot wash out by collecting more data. A noisy-but-unbiased estimate converges to the truth; a biased one converges to the wrong answer with growing confidence.

Here is the precise picture, and it is the seed of this entire lesson. Your uncertainty about the robot's state is a little cloud — a spread of plausible positions. You want to know: after I push this cloud through the curved sensor function, where does the transformed cloud's center land? The E-K-F answers by pushing only the center of your cloud through the curve, then drawing a tangent line and stretching the spread along it. But on a curve, the center of the transformed cloud is not the transform of the center. Bend a spread of points around a curve and they bunch up on one side — the true average of the warped points lands somewhere the tangent line never sees.

Let's watch it before we name anything. Below, a Gaussian cloud of uncertainty (the blue points) sits on the left. A curved function bends it as it passes through, producing the warped orange cloud on the right. Compare two answers for "where is the center of the warped cloud?": the true mean of all the warped points, versus the E-K-F's tangent-line guess, which is just the curve applied to the input center. Crank the curvature slider and watch the gap between them open up.

The tangent line vs. the truth — push a cloud through a curve

A cloud of input points (your uncertainty) is pushed through a curved function and lands as the warped cloud. The true mean is the actual average of the warped points. The E-K-F estimate is the curve applied to the input center only (the tangent-line answer). On a straight function they agree. Drag the curvature up and watch them split — the E-K-F mean drifts away from the truth.

Curvature 55 Spread 60 gap: —

Notice two things as you play. First, at zero curvature (a straight line) the green and red marks sit exactly on top of each other — for a linear function the tangent line is the function, so the E-K-F is exact. Second, the moment you add curvature, the warped cloud lopsides — more points pile up on the steep side — and its true center (green) slides away from the E-K-F's tangent answer (red). The wider you make the spread, the bigger the gap, because a wider cloud reaches further into the curved region where the linear approximation breaks down. Sharp curve plus wide uncertainty equals large bias. That is exactly the regime where the E-K-F fails and where the rest of this lesson lives.

The one-sentence thesis of this lesson. The E-K-F approximates the curved function with a tangent line, which biases the transformed mean. The Unscented Kalman Filter instead approximates the cloud of uncertainty with a handful of cleverly chosen points, pushes each through the true curve, and recovers the mean and spread from the warped points. It captures the curvature the tangent line throws away — with no Jacobians at all.

Why this matters more than it sounds

"A small bias in a position estimate" sounds academic until you remember where these filters live. A spacecraft estimating its attitude from star trackers and gyros is fusing through trigonometric curves — sines and cosines of angles — with very tight accuracy demands; a biased estimate points the antenna at empty sky. A GPS receiver turning satellite ranges into a position fixes a profoundly nonlinear set of distance equations; bias here is a car in the wrong lane. A robot fusing bearing measurements (angles to landmarks) is working with atan2, one of the most viciously curved functions there is. In all of these, the E-K-F's tangent line is not a harmless simplification — it is a structural source of error that grows precisely when the uncertainty is large, which is exactly when you most need the filter to be right.

And the cure is not "linearize more carefully" or "use a smaller step." Those help a little. The cure, due to Simon Julier and Jeffrey Uhlmann in 1997, is to stop linearizing at all — to flip the whole problem on its head. That flip is so clean it feels like a magic trick the first time you see it, and it is the subject of Chapter 2. But first, one chapter to make sure the E-K-F's exact failure is crisp in your mind, because the U-K-F is best understood as the precise fix for that exact failure.

Why is the E-K-F's linearization error so dangerous on a sharply curved function, beyond "just being inaccurate"?

Chapter 1: A Two-Minute Recap — What Exactly Does the E-K-F Do?

Before we build the new thing, let's pin down the old thing in one tight chapter, because the U-K-F is the answer to a question the E-K-F asks badly. If Lesson 7 is fresh, skim this; if it's hazy, this is the part you need.

The plain Kalman filter (Lesson 5) is a perfect fuser when everything is linear: when your motion model and your sensor model are both straight-line maps of the form "output equals a matrix times the state." Under that linearity, the Kalman filter is provably optimal — no estimator does better. The trouble is that the real world is rarely linear. A range sensor reads distance, which is a square root. A bearing sensor reads an angle, which is an arctangent. A car's motion bends through sines and cosines of its heading. The clean matrix the Kalman filter needs simply isn't there.

The E-K-F's answer is the most natural thing a calculus student would try: replace the curve with its tangent line at the current estimate. Concretely, take the nonlinear sensor function h(x) — the map from state to measurement — and approximate it near your best guess by the first two terms of its Taylor expansion:

h(x) ≈ h(x̂) + H · (x − x̂)

where H is the Jacobian — the matrix of partial derivatives of h, evaluated at x̂. That Jacobian is the slope of the tangent line (in many dimensions, the slopes in every direction at once). Once you have H, you pretend the world is linear with that slope and run the ordinary Kalman update. The E-K-F is "Kalman filter on the local tangent plane."

The mental model: a flat map of a round world. Linearizing is like printing a flat street map of a city. Over a few blocks the flat map is perfect — the Earth's curvature is invisible at that scale. But try to use that same flat map across a whole continent and the errors become absurd (Greenland looks bigger than Africa). The tangent line is a flat map of a curved function: trustworthy in a small neighborhood of x̂, increasingly wrong as your uncertainty cloud spreads further from that point. The E-K-F bets that your uncertainty is small enough to stay "within a few blocks." When it isn't, the bet loses.

The two structural costs of the tangent-line trick

The E-K-F carries two distinct burdens, and the U-K-F was designed to kill both at once. Keep them separate in your mind:

Cost 1 — you must compute the Jacobian. For every nonlinear model in your system, you must work out the matrix of partial derivatives by hand (or symbolically), code it, and re-evaluate it every single step. For a simple range sensor that's a quick derivative. For a 15-state inertial navigation model fusing GPS, IMU, and magnetometer through messy trigonometry, the Jacobian is a dense, error-prone matrix that engineers dread. A single sign error in one partial derivative produces a filter that looks like it's working — it converges, it tracks — but is subtly, persistently wrong. These bugs are notorious.

Cost 2 — the tangent line biases the mean (Chapter 0's crime). Even with a perfectly correct Jacobian, the linear approximation is only accurate to first order. The curvature — the second-order behavior, the very thing that bends a tangent line off the curve — is thrown away. So the transformed mean is wrong by an amount that grows with the curvature and with the size of your uncertainty, exactly as you saw in the Chapter 0 sim.

The E-K-F's choiceThe consequence
Approximate the function with a tangent lineNeed the Jacobian (Cost 1) and lose the curvature (Cost 2)
Accurate to first order onlyBias grows with curvature × uncertainty
Exact only when the function is linearFine on gentle curves, biased on sharp ones

Here is the question that opens the door to the U-K-F. The E-K-F's whole strategy is built on approximating the function — replacing the hard, curved h(x) with an easy, straight line. What if that's the wrong thing to approximate? The function is fixed and curved; fighting it with a tangent line is fighting its nature. But the thing we actually care about — our uncertainty — is just a cloud of points, and a cloud is a much simpler object than a function. What if we approximated the cloud and left the function alone? That single change of target is the U-K-F, and it's the next chapter.

The crisp setup for the rest of the lesson. The E-K-F approximates the nonlinear function with a tangent line. This (1) forces you to compute Jacobians and (2) biases the transformed mean by discarding curvature. Both costs come from the same decision — approximating the function. The U-K-F makes a different decision, and both costs vanish together.
What is the single decision at the heart of the E-K-F from which both of its costs (needing Jacobians, biasing the mean) flow?

Chapter 2: The Key Flip — Approximate the Distribution, Not the Function

Here is the idea, in one sentence, that the rest of the lesson elaborates: it is easier to approximate a probability distribution than it is to approximate an arbitrary nonlinear function. Julier and Uhlmann put it almost exactly that way in 1997, and it is the whole U-K-F in a thought. Let it land before we make it mechanical.

Think about what each object is. A nonlinear function — like a range sensor's square root, or a bearing sensor's arctangent — can twist and bend in infinitely many ways. To capture all of its behavior with a straight line is hopeless; the line is only ever right at one point. That's the E-K-F's bind: it's trying to summarize an infinitely-rich curved object (the function) with the crudest possible summary (a line).

Now think about what we're actually uncertain about. Our belief about the state is a Gaussian — a cloud described by just two things: its mean (where it's centered) and its covariance (how spread out it is, and in which directions). That's it. A Gaussian, however high-dimensional, is pinned down completely by a center and a spread. It is a finite, simple object. And here's the leap: a center and a spread can be captured exactly by a small, finite set of sample points — you don't need a thousand random samples, you need a handful of carefully placed ones.

The flip, stated plainly. Don't approximate the curve and then push your cloud through the approximation (E-K-F). Instead: approximate your cloud with a few well-chosen points, push each of those points through the real, untouched curve, and rebuild a cloud from where they land. You never simplify the function. You let the true nonlinearity act on real points, and you measure what comes out.

Why this is so much better, intuitively

Picture the difference physically. The E-K-F takes your cloud, finds its center, draws a tangent line through that one center point, and slides the whole cloud along the line. Every point in the cloud is being told "pretend the curve is the tangent line here." Points far from the center get this badly wrong, because out there the curve has peeled away from the line.

The U-K-F does something honest instead. It places a few representative points across your cloud — one at the center, a few out toward the edges of the spread — and then it asks the actual curve, "where does each of these points really go?" It pushes them through h(x) itself, no approximation. The points that started near the edge of the spread land wherever the true curve sends them, bunching and stretching exactly as the real nonlinearity dictates. Then it looks at where the warped points landed and computes their average and spread. That average naturally captures the lopsidedness the tangent line missed — because the points really went there.

The cannonball analogy. Suppose you fire a cannon and the muzzle angle is uncertain — somewhere in a small range. You want to know the spread of landing spots. The E-K-F way: take the average angle, compute where that shot lands, and draw a straight line of "sensitivity" to estimate the spread — but trajectories are curved (parabolas), so this misjudges the landing cloud. The U-K-F way: fire a few test shots at the lowest, average, and highest plausible angles, see where each actually lands, and read the spread of landing spots off those real impacts. You used the true physics on a few representative inputs instead of a flat approximation on all of them. Of course the few-real-shots answer is better — it never pretended the trajectory was straight.

The accuracy payoff, named

This isn't just hand-waving better; it's provably better, and the proof has a clean headline. The E-K-F captures the transformed mean to first order in a Taylor sense — it gets the linear part right and discards everything curved. The unscented transform (the engine we build next chapter) captures the transformed mean to at least second order for any nonlinearity, and to third order when the underlying distribution is Gaussian. In plain terms: it correctly accounts for the leading curvature term — the exact term the E-K-F throws away — which is why the green and red marks in the Chapter 0 sim agreed for a line but split for a curve.

The flip and its consequence. The E-K-F approximates the function (a hard, infinite object) and is first-order accurate. The U-K-F approximates the distribution (an easy, finite object — just a mean and covariance, captured by a few points) and is second-to-third-order accurate. Same problem, a better choice of what to approximate, and as a free bonus: because you only ever evaluate the true function at points, you never differentiate it — no Jacobians. The next three chapters make this completely concrete: how to pick the points (Chapter 3), how to push and recombine them (Chapter 4), and how to wrap it into a full filter (Chapter 5).
What is the "flip" that defines the U-K-F's approach?

Chapter 3: Sigma Points — A Few Points That Carry the Whole Cloud

The flip rests on one claim that needs earning: that a Gaussian cloud — an infinite spread of possibilities — can be represented by a tiny, finite set of points. Not approximated loosely; represented exactly, in the sense that those few points carry precisely the cloud's mean and covariance. The points that do this job are called sigma points, and choosing them is the heart of the unscented transform.

The name is a clue: the points are placed at the sigma (the standard deviation) of the distribution — out at the edges of the spread, not scattered randomly. The recipe is almost insultingly simple. For a state with n dimensions, you use 2n + 1 sigma points:

So a 1-dimensional state (n = 1) gets 3 sigma points: the mean, one to the right, one to the left. A 2-dimensional state gets 5; a 3-dimensional state gets 7; the 15-dimensional inertial navigation state gets 31. The count grows only linearly with dimension — that's the difference between this and a brute-force Monte Carlo that would need thousands of samples.

The mental model: tripod legs. To know where a tripod sits and how wide it stands, you don't need to photograph every point on it — you need its center and the position of each foot. The mean sigma point is the center; the ± pairs are the feet, planted at the edge of the spread in each independent direction. Photograph just those, push them through whatever transformation you like, and you can reconstruct the whole tripod's new position and stance from where the feet landed.

Where exactly do you put the ± points? One number on the back of an envelope

Consider the simplest case: a 1-D Gaussian with mean μ = 2 and variance P = 4 (so a standard deviation of 2). We need three sigma points. The center one is easy: it sits at the mean, μ = 2. The other two step out from the mean by an amount governed by the covariance. The step is the square root of a scaled covariance:

step = √((n + λ) · P)

where n is the state dimension (here 1) and λ (lambda) is a scaling parameter — a single tuning knob that controls how far out the points reach. We'll treat λ's exact value in Chapter 8; for now take the common choice λ = 2 for a 1-D problem (it comes from λ = α²(n + κ) − n with the standard defaults, but the value is all we need here). Plug in:

step = √((1 + 2) × 4) = √(3 × 4) = √12 ≈ 3.46

So the three sigma points are:

Sigma pointLocationValue
χ0 (center)μ2
χ1 (plus)μ + step2 + 3.46 = 5.46
χ2 (minus)μ − step2 − 3.46 = −1.46

Three numbers — 2, 5.46, −1.46 — now stand in for the entire Gaussian. The center captures the mean; the symmetric ±3.46 pair captures the spread. (In many dimensions, the "step" becomes a step along each direction the covariance stretches, computed from a matrix square root of P — the multidimensional cousin of √P — but the spirit is identical: step out along the axes of the spread.)

The weights — not every point votes equally

Pushing the points through the function isn't enough; when we rebuild the cloud on the far side, we'll take a weighted average of the warped points, and each sigma point carries its own weight. Why weighted? Because the center point and the edge points play different roles, and the math of matching a Gaussian's moments demands they count differently. There are two sets of weights — one set for recombining the mean (call them Wm) and one for the covariance (Wc) — and they share the same simple structure:

W0m = λ / (n + λ)   (weight on the center point for the mean)
Wi = 1 / (2(n + λ))   (weight on each of the 2n edge points)

Run our 1-D numbers (n = 1, λ = 2, so n + λ = 3): the center weight is W0m = 2/3 ≈ 0.667, and each of the two edge points gets 1/(2×3) = 1/6 ≈ 0.167. Sanity check — the weights must sum to 1 (it is an average, after all): 0.667 + 0.167 + 0.167 = 1.00. ✓ The center point dominates (two-thirds of the vote) and the two edge points split the remaining third, which makes intuitive sense: the center is the most likely state, the edges are the less-likely tails.

Common misconception. "The weights are how probable each sigma point is." Close, but not quite — and the difference matters. The weights are not probabilities; they're the coefficients that make the weighted sum of the points reproduce the Gaussian's mean and covariance exactly. In fact, the center weight W0 can even be negative for high-dimensional states with certain parameter choices — a "probability" can't be negative, but a moment-matching coefficient can. Think of the weights as a recipe for reconstructing the cloud, not as odds.

Below, set a 1-D Gaussian's mean and spread and watch the three sigma points place themselves — the center on the mean, the symmetric pair stepped out by √((n+λ)P). The numbers update live so you can match them against the worked example above (try μ=2, and read off ≈5.46 and ≈−1.46).

Sigma-point placement — three points carry a 1-D Gaussian

The curve is your Gaussian belief. The three sigma points are placed on it: one at the mean, two stepped out by √((n+λ)·P). Adjust the mean and spread and watch the points track. The bar heights show each point's weight — the center dominates, the edges split the rest, and they always sum to 1.

Mean μ 2.0 Variance P 4.0 σ-points: —

In code — generating sigma points is a half-dozen lines

For a 1-D state the whole thing is short. Notice there is no derivative, no Jacobian — only a square root of the covariance to find the step:

python
import numpy as np

def sigma_points_1d(mu, P, n=1, lam=2.0):
    step = np.sqrt((n + lam) * P)        # how far the ± points reach
    pts  = [mu, mu + step, mu - step]    # center, plus, minus
    # weights: center gets lam/(n+lam); each edge gets 1/(2(n+lam))
    Wm = [lam/(n+lam), 1/(2*(n+lam)), 1/(2*(n+lam))]
    return np.array(pts), np.array(Wm)

pts, Wm = sigma_points_1d(2.0, 4.0)
# pts -> [ 2.   5.46 -1.46 ]   Wm -> [0.667 0.167 0.167]  (sums to 1.0)

That's the entire sigma-point machinery. Three points and three weights stand in for a Gaussian, computed with a square root and no calculus. In the next chapter we feed these three points through a real nonlinear function and watch the cloud reassemble — correctly — on the other side.

For a 3-dimensional state, how many sigma points does the unscented transform use, and where do they sit?

Chapter 4: The Unscented Transform — Push the Points, Recover the Cloud

We have the sigma points. Now we run the actual maneuver — the unscented transform — and watch it beat the E-K-F on a real curve, by hand, with real numbers. The whole procedure is three steps, and once you've done it once you own it forever:

Step 1 — choose
Pick the 2n+1 sigma points from your mean and covariance (Chapter 3)
Step 2 — push
Send each sigma point through the true nonlinear function: 𝒬i = f(χi)
Step 3 — recover
Take the weighted mean and weighted covariance of the warped points

The worked example: pushing a Gaussian through y = x²

We'll use the cleanest curved function there is: y = x². It's a parabola — gentle near zero, steep far out — and crucially, we can compute the true answer exactly and check our work. Our input is the 1-D Gaussian from Chapter 3: mean μ = 2, variance P = 4. The question: after squaring, what is the mean of the output?

The naive (E-K-F-style) guess first. The tempting answer is "just square the mean": f(μ) = 2² = 4. This is exactly what the E-K-F's tangent line reports — it evaluates the function at the center and calls that the output mean. Hold onto the number 4; we'll see it's wrong.

The true answer, for reference. For y = x² with input mean μ and variance P, calculus gives the exact output mean: E[x²] = μ² + P = 2² + 4 = 4 + 4 = 8. The true mean of the squared cloud is 8, not 4 — the variance adds 4 to the naive guess, because squaring stretches the far-out points more than the near ones, dragging the average upward. The E-K-F's "4" is off by a full 100%. This is the bias from Chapter 0, made arithmetic.

Now the unscented transform. We push our three sigma points (computed in Chapter 3: χ = [2, 5.46, −1.46], weights Wm = [0.667, 0.167, 0.167]) through y = x²:

Sigma point χiWarped 𝒬i = χi²Weight WimContribution Wi·𝒬i
2.002.00² = 4.000.6670.667 × 4.00 = 2.668
5.465.46² = 29.810.1670.167 × 29.81 = 4.978
−1.46(−1.46)² = 2.130.1670.167 × 2.13 = 0.356

Now sum the contributions to get the recovered output mean:

μy = 2.668 + 4.978 + 0.356 = 8.00

The unscented transform recovers 8.00exactly the true mean. Not close, exactly. Compare the scoreboard:

MethodOutput mean for y=x², input N(2, 4)Error
True answer (calculus)8.00
Unscented transform8.000.00 — exact!
E-K-F (square the mean)4.00−4.00 (off by 100%)

Sit with that. The E-K-F said the squared cloud is centered at 4; the truth is 8; the unscented transform — using only three points and a square root, no Jacobian, no calculus — nailed 8. It "saw" the curvature because it let the curve act on the spread-out sigma points (the one at 5.46 squared to a huge 29.81 and pulled the average up), exactly as the true distribution does. The E-K-F never saw it because it only ever evaluated the curve at the single center point.

Why it's exact here (and second/third order in general). For y = x² the unscented transform is exactly right because a parabola's curvature is captured completely by the second moment (the variance), and the symmetric sigma points reproduce the variance exactly. For a general nonlinearity it's not perfectly exact, but it correctly captures the leading curvature term — second order for any function, third order when the input is Gaussian — whereas the E-K-F stops at first order. The squared example is the cleanest possible demonstration that "push real points through the real curve" beats "square the mean."

Recovering the spread, too

The transform doesn't just recover the mean — it recovers the output covariance the same way, as a weighted average of how far each warped point lands from the recovered mean. For each warped point compute its deviation (𝒬i − μy), square it, weight it (with the covariance weights Wc), and sum:

Py = ∑i Wic · (𝒬i − μy

So one pass of "push the points" hands you back both the new mean and the new spread — a complete Gaussian on the output side. That is everything a Kalman-style filter needs to keep going. The function was never approximated; we only ever evaluated it at points and measured the result.

The transform in code — the whole thing

python
import numpy as np

def unscented_transform(mu, P, f, n=1, lam=2.0):
    # 1. choose sigma points (1-D)
    step = np.sqrt((n + lam) * P)
    chi  = np.array([mu, mu + step, mu - step])
    Wm   = np.array([lam/(n+lam), 1/(2*(n+lam)), 1/(2*(n+lam))])
    # 2. push EACH point through the TRUE function (no Jacobian!)
    Y = np.array([f(c) for c in chi])
    # 3. recover mean and covariance from the warped points
    mu_y = np.sum(Wm * Y)
    P_y  = np.sum(Wm * (Y - mu_y)**2)
    return mu_y, P_y

mu_y, P_y = unscented_transform(2.0, 4.0, lambda x: x**2)
# mu_y -> 8.0   (the EKF would say 4.0)   true answer = 8.0  ✓

Run it in your head: f is x**2, the three sigma points get squared, the weighted sum is 8.0. Swap f for any function — a square root for a range sensor, an atan2 for a bearing sensor — and the same three lines work, because we never differentiated f. That generality, with no Jacobian to derive, is the U-K-F's quiet superpower.

Below, push a draggable Gaussian through y = x² and watch the unscented transform recover the mean exactly while the E-K-F's "square the mean" sits stubbornly low. The three sigma points are shown squaring themselves; their weighted average is the green mark, the truth is the dashed line, and the E-K-F is the red mark.

Unscented transform vs. E-K-F on y = x²

Set the input mean and variance. The three sigma points get squared (watch them on the parabola). The U-T mean is their weighted average; the E-K-F mean is just (mean)²; the dashed line is the true mean μ²+P. The U-T sits on the truth; the E-K-F sits low by exactly P.

Mean μ 2.0 Variance P 4.0
Pushing N(μ=2, P=4) through y=x², the true output mean is 8. Why does the E-K-F report 4 while the unscented transform reports 8?

Chapter 5: The U-K-F Loop — Predict and Update Through Sigma Points

We have the engine — the unscented transform turns "Gaussian in, nonlinear function, Gaussian out" into a few points pushed through the true curve. A full filter is just that engine run twice per timestep: once for the predict step (push the belief through the motion model) and once for the update step (push the predicted belief through the sensor model and fuse with the measurement). Same Kalman skeleton you already know — predict, then correct — with the unscented transform standing in wherever the old filter needed a linear map.

The predict step — where will the state be next?

The motion model f(x) says how the state evolves from one tick to the next (a car drives forward and turns; a satellite tumbles). It's usually nonlinear — sines and cosines of heading, for instance. The U-K-F predict step is exactly the unscented transform applied to f:

  1. Build the 2n+1 sigma points from the current mean and covariance.
  2. Push each sigma point through the true motion model f — "if the state were here, where would it move to?"
  3. Recover the predicted mean and covariance as the weighted average of the moved points.
  4. Add the process noise Q to the covariance (the motion model is imperfect; this admits that uncertainty).

The output is a predicted Gaussian: where we think the state is now, before looking at any sensor, and how unsure we are. No Jacobian of f was ever taken.

The update step — fold in the measurement

Now a sensor reports a measurement z. The sensor model h(x) maps state to expected measurement (often the curved one — range, bearing). The update step runs a second unscented transform, this time through h, and then does the Kalman correction:

  1. Build fresh sigma points from the predicted mean and covariance.
  2. Push each through the sensor model h — "if the state were here, what would the sensor read?" Recover the predicted measurement mean and its covariance (add measurement noise R).
  3. Compute the cross-covariance between state and measurement — a weighted sum pairing each state sigma point's deviation with its measurement sigma point's deviation. This captures "when the state is off in this direction, the measurement is off in that direction," and it replaces the role the Jacobian played in the E-K-F.
  4. Form the Kalman gain K = (cross-covariance) · (measurement-covariance)−1 — the trust dial deciding how hard to pull the estimate toward the surprise.
  5. Correct: nudge the mean by K times the innovation (the gap between the actual measurement z and the predicted measurement), and shrink the covariance accordingly.
The mental model: it's the same Kalman dance, danced with points. The ordinary Kalman filter predicts, then corrects, with the Kalman gain as a trust slider between "what I expected" and "what I saw." The U-K-F does the identical dance — predict, correct, gain as trust slider — but every place the old filter multiplied by a matrix (the linear model) or a Jacobian (the linearized model), the U-K-F instead pushes sigma points through the true function and reads off the result. The cross-covariance, computed from the sigma points, is the U-K-F's stand-in for the Jacobian: it tells the gain how state errors couple to measurement errors, learned by experiment rather than by differentiation.

The structural contrast, side by side

StepE-K-F does…U-K-F does…
Predict meanf(x̂) at the center onlyweighted avg of f(χi) over all sigma points
Predict covarianceF·P·FT + Q (F = Jacobian of f)weighted spread of moved sigma points + Q
Measurement couplingJacobian H of hcross-covariance of sigma points (no H)
Gain & correctstandard Kalman updatestandard Kalman update
Calculus requiredJacobians F and H, derived by handnone — only function evaluations

Read the bottom row again: the U-K-F replaces every Jacobian with sigma-point evaluations. You hand it the motion model f and the sensor model h as ordinary functions — "give me a state, I'll give you the next state / the expected measurement" — and the filter never asks for a derivative. Swapping in a new sensor means writing one new h function; in the E-K-F it also means deriving and debugging a new Jacobian matrix.

The payoff, restated. The U-K-F is the ordinary Kalman predict/correct loop with the unscented transform plugged into the two nonlinear slots. You get the E-K-F's job done — nonlinear fusion — with (1) better accuracy on curves (second/third order vs first) because the transform captures curvature, and (2) zero hand-derived Jacobians because you only ever evaluate the models, never differentiate them. Two pains of the E-K-F, gone, for the modest price of evaluating your models at 2n+1 points instead of one.

Watch one full predict-then-update cycle

Below, a 2-D state (the dot) is tracked through one U-K-F cycle. Step through it: the sigma points spread out from the current belief, get pushed forward by the motion model (predict), then a noisy measurement arrives and the belief is pulled toward it by the Kalman gain (update). The covariance ellipse grows on predict (more unsure) and shrinks on update (the measurement sharpened us). This is the entire loop, one click at a time.

One U-K-F cycle — predict (push sigma points) then update (snap to measurement)

Press Step to advance: 1) spread the sigma points from the belief, 2) push them through the motion model (the ellipse grows — predict), 3) a measurement arrives, 4) the belief snaps toward it and the ellipse shrinks (update). The truth is the dashed dot. Run auto-cycles.

Meas. noise 18 ready — press Step
In the U-K-F update step, what plays the role that the Jacobian H plays in the E-K-F?

Chapter 6: Showcase — The Unscented Transform, Live

This is the payoff. Everything from the last six chapters — the cloud, the sigma points, the push through the true curve, the recovered mean, and the contrast with the E-K-F's tangent line — running together in one panel you can break. Drag the nonlinearity, fatten the uncertainty, and watch the U-K-F's win grow exactly where the theory said it would.

Here's the setup. A Gaussian blob of uncertainty sits on the input axis. A nonlinear function (whose curvature you control) bends it as it passes through. We draw, on the output side: the true warped cloud (a dense scatter, the ground truth), its true mean, the U-K-F's recovered mean from just the sigma points, and the E-K-F's tangent-line mean. The numbers update live. The whole lesson is in the gap between the green/orange marks (which track each other) and the red mark (which drifts off as you bend the curve).

Interactive unscented transform — the U-K-F win, live

An input Gaussian (left/bottom) is pushed through a curved function (drawn diagonally). On the output, compare the true mean, the U-K-F mean (from 3 sigma points, shown as rings), and the E-K-F mean (tangent line). Curvature bends the function; Uncertainty fattens the blob. Watch the U-K-F hug the truth while the E-K-F drifts — and watch the gap grow with both sliders.

Curvature 45 Uncertainty 50
drag the sliders — watch the E-K-F mean drift off the truth

The four experiments to run — reproduce every claim with your own eyes

Don't just watch; falsify. Run this sequence and confirm each prediction:

  1. Curvature to 0. The function becomes a straight line. The green, orange, and red marks collapse onto each other — all three agree. This is the E-K-F's home turf: on a linear function, linearization is exact and the U-K-F offers nothing extra. Predicted by Chapter 0.
  2. Crank curvature up. The warped cloud lopsides; the green (true) and orange (U-K-F) marks slide together to the true center, while the red (E-K-F) mark stays stubbornly behind on the tangent line. The U-K-F tracks the curvature; the E-K-F can't. The "gap" readout grows.
  3. Now fatten the uncertainty too. The gap grows further — a wider blob reaches deeper into the curved region, so the linear approximation is wrong over a bigger range. This is the "curvature × uncertainty" rule from Chapter 0, live: bias scales with both.
  4. Shrink uncertainty back down (tiny blob), keep high curvature. The gap nearly closes again — even on a sharp curve, if your uncertainty is tiny the cloud stays in the small neighborhood where the tangent line is fine. This is why the E-K-F survives in practice: well-tuned filters keep uncertainty small. The U-K-F's edge appears precisely when you can't.

The crucial contrast is experiments 2 and 4 against each other. Same sharp curve, opposite outcomes — because the E-K-F's error isn't about the curve alone, it's about how much of the curve your uncertainty samples. The U-K-F is robust to both because it samples the true curve at the actual edges of your spread, wherever they are. The E-K-F bets your uncertainty stays small; the U-K-F doesn't have to bet.

You just watched the whole lesson run. The sigma points (rings) carry your cloud; they get pushed through the real curve; their weighted average (orange) lands on the truth (green) while the tangent line (red) drifts. Curvature and uncertainty each widen the E-K-F's error, and the U-K-F shrugs both off. This "bend it and watch the means split" is the exact experiment that justifies reaching for a U-K-F — and in Chapter 9 we'll turn it into a debugging test: if your E-K-F is biased, this is the picture of why.

Now measure the win — sweep the uncertainty and plot both errors

The sim showed the gap grow as you fattened the blob. Let's make that a curve. Sweep the input spread σ from tiny to wide, push N(2, σ²) through y=x² with each method, and plot the mean error against the true E[x²]=μ²+σ². You'll see the exact shape Chapter 0 promised: the E-K-F error climbing as σ² while the U-K-F line hugs zero.

Chapter 7: Use Cases & Real Products — Where Sigma Points Earn Their Keep

Every lesson in this series ends with the same four chapters — Use Cases, Practical Application, Debugging, Connections — because a method you can't point at in a shipped system is a method you don't really own. So before any more theory, let's ground the U-K-F in real hardware. The pattern to watch for: the U-K-F shows up exactly where the nonlinearity is sharp, the uncertainty is large, or the Jacobian is a nightmare to derive — the three conditions where the E-K-F's tangent line hurts most.

Spacecraft & satellite attitude estimation. A spacecraft estimates which way it's pointing by fusing gyroscopes (which drift) with star trackers and sun sensors (absolute, but reading angles). Attitude is expressed in quaternions or rotation matrices, and the maps from "orientation" to "what the star tracker sees" are deeply trigonometric — sines and cosines everywhere, with tight accuracy demands (a fraction of a degree). The Jacobians are miserable to derive correctly, and a small bias points the high-gain antenna at empty space. The Unscented Kalman Filter for spacecraft attitude is a textbook application precisely because it sidesteps the quaternion Jacobians and captures the curvature the E-K-F would bias.

GPS / INS integration with strong nonlinearity. Fusing GPS (absolute position from satellite ranges — a curved distance map) with an inertial navigation system (the IMU's accelerations and rotations) is the canonical navigation problem. When the dynamics are gentle the E-K-F suffices, but during aggressive maneuvers, large initial uncertainty (a "cold start" with no good prior), or long GPS outages where the IMU's covariance balloons, the linearization bias bites — and the U-K-F's curvature-aware transform keeps the fused estimate honest where the tangent line would drift.

Robotics: bearing-only and range-only SLAM. A robot that sees landmarks only as angles (a single camera) or only as distances (a sonar ring) is fusing through atan2 and square roots — among the most curved functions in robotics, and with notoriously fat uncertainty before the landmark is well-triangulated. This is exactly the "sharp curve + wide cloud = big bias" regime from Chapter 0, and it's where the U-K-F (and its cousins) routinely replace the E-K-F for localization and mapping.

Battery state-of-charge & process estimation. Far from robotics, the U-K-F is a staple of battery management systems. A lithium battery's voltage relates to its state-of-charge through a steeply nonlinear curve, and you can't measure charge directly — you infer it by fusing current and voltage through that curve. The U-K-F estimates "how full is this battery" in your phone and EV. Chemical-process and power-system estimation lean on it for the same reason: the models bend hard and the Jacobians are ugly.

The pattern across products

Notice the recurring reason engineers reach for the U-K-F over the simpler E-K-F:

SystemNonlinear map being fused throughWhy U-K-F over E-K-F
Spacecraft attitudeorientation → star/sun-sensor angles (trig)brutal quaternion Jacobians; tight accuracy
GPS / INS navigationposition → satellite ranges (√)large uncertainty during outages / cold start
Bearing-only SLAMlandmark → angle (atan2)extreme curvature + fat prior uncertainty
Battery state-of-chargecharge → terminal voltage (steep curve)sharp nonlinearity, no direct measurement
Target tracking (radar)position → range/bearing/Dopplerpolar-to-Cartesian curvature, big initial cov.

The deep case: why spacecraft attitude is the U-K-F's home

The attitude problem is worth a closer look because it concentrates every reason the U-K-F exists. A spacecraft's orientation lives on a curved space (the set of rotations — not a flat vector space), and the gyros measure angular rate while the star tracker measures the direction of known stars. To fuse them, you map "current orientation" to "expected star directions," and that map is a stack of trigonometric functions. Three things make the E-K-F painful here, and the U-K-F fixes all three at once:

This is why "UKF for spacecraft attitude estimation" is a phrase you'll see across the aerospace literature, and why the original Julier–Uhlmann motivation came partly from navigation and tracking problems where the E-K-F's linearization had been quietly costing accuracy for decades.

How to spot a U-K-F-shaped problem in the wild

You can now diagnose whether a system should be using a U-K-F from its description. Three tells:

When all three appear together — curved maps, wide uncertainty, ugly Jacobians — the U-K-F is almost certainly the right tool, and many shipped systems quietly switched to it for exactly that combination.

The deployable insight. Reach for the U-K-F when (1) the nonlinearity is sharp (angles, ranges, trig, steep curves), (2) the uncertainty is large (cold starts, outages, aggressive maneuvers), or (3) the Jacobian is painful or bug-prone to derive. If your system is gentle, well-tuned, and the Jacobian is a one-liner, the E-K-F is simpler and fine. The U-K-F is the tool for the hard nonlinear corner the E-K-F handles badly.
A spacecraft fuses gyros with a star tracker to estimate attitude, the maps are heavily trigonometric, the Jacobians are error-prone to derive, and after a tumble the uncertainty is large. Why is this a textbook U-K-F application?

Chapter 8: Practical Application — Tuning Alpha, Beta, Kappa, and Choosing U-K-F vs E-K-F

You know the U-K-F's machinery. Now the engineer's question: how do you actually set it up, and when do you reach for it over the simpler E-K-F? This recurring "now build it" chapter turns the theory into knobs you can turn and a decision you can make.

The three spread parameters: α, β, κ

Back in Chapter 3 we used a single scaling parameter λ and quietly noted it comes from three more fundamental knobs. In the standard "scaled unscented transform," the spread is controlled by three parameters — α (alpha), β (beta), and κ (kappa) — combined into λ = α²(n + κ) − n. You rarely need to think hard about them, because there are well-known sensible defaults, but here's what each one does so you can reason about them:

ParamControlsIntuitionTypical value
α (alpha)how far the sigma points spread from the meansmall α → points hug the mean (safer for very local nonlinearity); large α → points reach far outsmall, e.g. 1e−3 to 1
κ (kappa)secondary spread / scalingoften set to 0, or to 3−n to match a Gaussian's fourth moment0 (or 3−n)
β (beta)incorporates prior knowledge of the distribution's shape into the covariance weightsfor a Gaussian, β = 2 is optimal2 (Gaussian)
The intuition for α — the one knob you actually tune. α sets how far the sigma points reach from the mean. Think of it as "how much of the curve do I want to sample?" If the nonlinearity is wild only very close to the mean and you want the points to stay nearby, use a small α. If the interesting curvature is out in the tails of your spread, you want the points to reach out there, so a larger α. The default tiny α (around 10−3) keeps the points close — a conservative, numerically safe choice that works for most problems. β and κ you can almost always leave at their Gaussian defaults (β = 2, κ = 0) and forget.

The practical truth: start with α small (1e−3), β = 2, κ = 0, and only touch α if the filter misbehaves. The vast majority of U-K-F deployments never tune beyond these defaults. If you find yourself agonizing over α, β, κ, you're probably over-thinking it — the parameters are a fine-tuning luxury, not a setup chore.

When to choose U-K-F over E-K-F — a decision procedure

The two filters solve the same problem (nonlinear fusion); the choice is about which costs you're willing to pay. Run these questions:

Q1: Is the model nonlinear at all?
No → use the plain Kalman filter (Lesson 5); neither E-K-F nor U-K-F is needed
Q2: Is the nonlinearity sharp, or the uncertainty large?
Yes → lean U-K-F (captures curvature the tangent line biases). No (gentle + small uncertainty) → E-K-F is simpler and fine
Q3: Is the Jacobian painful, error-prone, or impossible to derive?
Yes → U-K-F (derivative-free; you only code the forward model). No → either works

The cost: 2n+1 evaluations vs 1, plus a square root

The U-K-F isn't free. Where the E-K-F evaluates each model once (at the center) per step, the U-K-F evaluates it 2n+1 times (once per sigma point), and it computes a matrix square root of the covariance each step to place the points. For a small state (n = 3, so 7 points) this is trivial. For a large state (n = 30, so 61 points) the per-step cost is noticeably higher than the E-K-F's, though both are still far cheaper than a particle filter's thousands of samples.

Cost axisE-K-FU-K-F
Model evaluations / step1 (at the center)2n+1 (one per sigma point)
Matrix square root / stepnoyes (to place the points)
Hand-derived Jacobiansyes — the development costnone
Accuracy on curvesfirst ordersecond / third order
The honest tradeoff. The U-K-F trades a bit more runtime cost (more evaluations, a square root) for a lot less development cost (no Jacobians) and better accuracy on curves. In an era where CPU cycles are cheap and engineer-hours debugging a sign error in a Jacobian are expensive, that trade usually favors the U-K-F — which is a big reason it spread so widely after 1997. Reach for the E-K-F only when the state is large enough that 2n+1 evaluations hurt and the nonlinearity is gentle enough that linearization is accurate.

A worked setup: a bearing-only tracker

Concrete example. You're tracking a target's 2-D position (n = 2, so 5 sigma points) from a sensor that reports only the bearing (angle) to it — an atan2, sharply curved. Walk the decision: Q1 nonlinear? Yes (atan2). Q2 sharp nonlinearity / large uncertainty? Both — atan2 is vicious and before triangulation the position uncertainty is wide. Q3 Jacobian painful? The bearing Jacobian is derivable but a classic place for sign errors. All three point to the U-K-F. Setup: state dimension n = 2, defaults α = 1e−3, β = 2, κ = 0, the sensor model h(x) = atan2(x_y − sensor_y, x_x − sensor_x) coded as a plain function, and you're done — no derivative anywhere. The filter pushes its 5 sigma points through that atan2 each update and reads off the bearing's predicted mean and spread.

The reusable recipe. (1) Confirm the model is actually nonlinear (else plain Kalman). (2) If the curve is sharp or the uncertainty is large, or the Jacobian is painful, choose the U-K-F. (3) Set α = 1e−3, β = 2, κ = 0 and only retune α if it misbehaves. (4) Code the forward models f and h as ordinary functions — that's the entire "derivation." (5) Accept 2n+1 evaluations per step as the price; it's cheap unless the state is huge. The development simplicity (no Jacobians) is usually the deciding factor.
Your team is setting up a U-K-F and is paralyzed choosing α, β, κ. What's the right practical advice?

Chapter 9: Debugging & Failure Modes — When the U-K-F Bites Back

The U-K-F is not magic; it has its own characteristic failures, and they're different from the E-K-F's. Knowing them is the difference between a filter you trust and one that diverges in the field at the worst moment. This recurring chapter catalogs the classic traps, the symptom each shows, and the specific test that exposes it.

Trap 1 — Non-positive-definite covariance (the most common U-K-F crash)

The U-K-F places its sigma points using a matrix square root of the covariance P. That operation only works if P is positive definite — intuitively, a "valid" spread with positive variance in every direction. But across many steps, numerical round-off, an overconfident measurement, or a too-aggressive parameter can nudge P into a state where it's no longer positive definite (a "negative variance" in some direction, which is physically nonsense). The square root then fails — the filter throws a math error or, worse, produces NaNs and silently corrupts every estimate downstream.

Symptom & detection. Symptom: the filter runs fine for a while, then suddenly produces NaNs or crashes in the square-root call, often right after a surprising measurement or a long prediction. Detection: check P's eigenvalues (or just attempt a Cholesky factorization) each step — if any eigenvalue goes negative (or Cholesky fails), P has lost positive-definiteness. Fix: the square-root U-K-F (SR-U-K-F), a numerically robust variant that propagates the square root of the covariance directly (never reconstructing P), so it's structurally guaranteed to stay positive definite. If you see covariance crashes, switching to the SR-U-K-F is the standard cure.

Trap 2 — Bad sigma weights (negative-weight surprises)

Recall from Chapter 3 that the center weight can go negative for high-dimensional states with certain parameter choices. A negative weight on the covariance recombination can, in pathological cases, produce a covariance that isn't positive semi-definite even before round-off — feeding straight into Trap 1. More subtly, a poorly chosen λ (from extreme α, κ) can place the sigma points absurdly far out, sampling the function in regions of near-zero probability and producing a garbage mean.

Symptom & detection. Symptom: the recovered covariance is wrong (sometimes negative-definite immediately), or the estimate is wildly off even on the first step, before any accumulation. Detection: print the weights and confirm the mean weights sum to 1; print the sigma points themselves and check they sit in plausible state regions (not at impossible values). Fix: use the scaled unscented transform (the α, β, κ formulation) which is designed to keep the points sensible, and use the modified covariance-weight form (the β term) that compensates. Sane defaults (α=1e−3, β=2, κ=0) avoid this entirely — the trap appears mostly when someone hand-picks exotic parameters.

Trap 3 — Using the U-K-F where it gives no benefit (near-linear problems)

The opposite mistake: reaching for the U-K-F when the problem doesn't need it. If your models are nearly linear and your uncertainty is small, the E-K-F's tangent line is already accurate — and the U-K-F buys you nothing for its extra cost (2n+1 evaluations, a square root each step). You've paid more runtime for identical accuracy.

Symptom & detection. Symptom: you switched from E-K-F to U-K-F "to be safe" and the estimates are indistinguishable — same accuracy, slower. Detection: run the Chapter 6 experiment on your models — push your actual prior cloud through your motion/sensor functions and compare the U-K-F mean against the E-K-F (square-the-mean) answer. If the gap is negligible at your real uncertainty levels, you're in the near-linear regime and the U-K-F is overkill. Fix: drop back to the E-K-F (or plain Kalman) and pocket the speed. The U-K-F earns its cost only when the curvature-times-uncertainty bias is real.

The bias test, worked as a table you can fill in

Here's the diagnostic that decides whether you even need a U-K-F. Push your real prior through your real sensor model both ways and tabulate. Example for a range sensor h(x) = √(x²) on a 1-D state, true output mean computed by dense sampling:

Your prior uncertaintyTrue output meanE-K-F meanU-K-F meanReading
small (σ tiny)10.0010.0010.00all agree → E-K-F is fine, U-K-F is overkill
medium10.3010.0510.28E-K-F starting to bias; U-K-F close
large (σ wide)11.2010.1011.15E-K-F badly biased → U-K-F clearly worth it

The table tells you the answer mechanically: run it at your operating uncertainty. If the E-K-F column tracks the truth, save the cycles. If it drifts (bottom row), the U-K-F is earning its keep and you should switch. Don't guess whether you need a U-K-F — measure the bias at your real uncertainty.

Trap 4 (bonus) — high-dimensional cost creep

The sigma-point count is 2n+1, growing linearly with state dimension. For a 60-state system that's 121 evaluations of your (possibly expensive) models every step. If your model evaluation is heavy — a complex dynamics simulation, a ray-cast, a learned network — the U-K-F's per-step cost can become the bottleneck, surprising teams who profiled on a small toy state.

Symptom & detection. Symptom: the filter is fast in prototyping (small state) but misses its real-time deadline once the full high-dimensional state is wired in. Detection: count model evaluations per step (2n+1) and multiply by your model's cost; profile at the real state dimension, not the toy one. Fix: consider the spherical simplex sigma-point set (uses only n+2 points instead of 2n+1, roughly halving the cost) for high dimensions, or partition the state so each filter handles a smaller block.

A debugging checklist you can run on any U-K-F

CheckHowCatches
Covariance stays valid?Cholesky / eigenvalues of P each stepTrap 1 (non-PD covariance → SR-U-K-F)
Weights sane?Print weights (mean weights sum to 1); print sigma-point locationsTrap 2 (bad weights / exotic λ)
Is the bias even there?Push your prior through h both ways; compare to dense-sample truthTrap 3 (U-K-F overkill on near-linear)
Real-time at full dimension?Count 2n+1 evals × model cost; profile at real nTrap 4 (cost creep)
Innovation reasonable?Watch the innovation (z − predicted z); should be small & zero-meandivergence / model mismatch (shared with all KFs)
The meta-lesson. The U-K-F's signature failure is the covariance going non-positive-definite (Trap 1) — cured by the square-root U-K-F. Its signature waste is using it where the E-K-F was already accurate (Trap 3) — cured by measuring the actual bias at your real uncertainty. Between "is my covariance valid?" and "is the bias actually there?", you catch nearly every U-K-F problem before it ships.
Your U-K-F runs for thousands of steps, then suddenly throws a math error in the matrix-square-root call and starts producing NaNs. What is the most likely cause and the standard fix?

Chapter 10: Connections, References & Cheat-Sheet

You can now fuse through a nonlinearity without ever drawing a tangent line or deriving a Jacobian. Before we point to what's next, here's everything in one place — the cheat-sheet to screenshot, the motto, the real sources, and the cross-links.

The U-K-F — cheat-sheet

The problem: the E-K-F approximates a curved function with a tangent line, which (1) needs a Jacobian and (2) biases the transformed mean (the mean of the warped cloud ≠ the curve applied to the input mean). Bias grows with curvature × uncertainty.

The flip: it's easier to approximate a distribution than a function. Approximate your Gaussian cloud with a few points, push each through the true curve, recover the mean & spread from the warped points. Never approximate the function.

Sigma points: 2n+1 points — one at the mean, a ± pair stepped out by √((n+λ)P) along each direction. They carry the mean & covariance exactly. Weights: center W0=λ/(n+λ); each edge 1/(2(n+λ)); they sum to 1.

Unscented transform (3 steps): choose sigma points → push each through the true f → recover weighted mean & covariance. Worked y=x² on N(2,4): true mean = 8, U-T = 8 (exact), E-K-F = 4 (off by 100%).

Accuracy: U-K-F captures the mean to second order (any nonlinearity), third order for Gaussians. E-K-F: first order only.

The U-K-F loop: ordinary Kalman predict/correct, with the unscented transform plugged into the two nonlinear slots (f for predict, h for update). The cross-covariance of sigma points replaces the Jacobian.

Parameters: λ=α²(n+κ)−n. Defaults α=1e−3, β=2 (Gaussian), κ=0; retune only α (how far points reach) if needed.

Cost: 2n+1 model evaluations per step + a matrix square root — vs the E-K-F's 1 evaluation but with hand-derived Jacobians.

Debugging: non-PD covariance → square-root U-K-F · bad weights → use scaled U-T defaults · no benefit → measure the bias, drop to E-K-F if it's small · high-dim cost → spherical-simplex sigma points.

The motto

"What I cannot create, I cannot understand." — Richard Feynman.
You can now create the unscented transform by hand — pick the points, push them through the curve, read off the answer — and predict exactly when it beats the tangent line.

The U-K-F vs E-K-F, in one quick-reference table

Screenshot this. It is the entire lesson collapsed into a single lookup:

E-K-FU-K-F
Approximates the…function (tangent line)distribution (sigma points)
Needs Jacobians?yes (hand-derived)no (function evals only)
Mean accuracyfirst ordersecond / third order
Cost per step1 evaluation2n+1 evaluations + a square root
Best when…gentle curve, small uncertaintysharp curve, large uncertainty, ugly Jacobian
y=x² on N(2,4)4 (true is 8)8 (exact)

Where this lesson sits in the series

This was Lesson 8 of 22. The arc so far: the plain Kalman filter (optimal, but linear-only) → the E-K-F (linearize with a tangent line) → the U-K-F (sigma points, no linearization). Each step handles a harder reality. But the U-K-F still assumes the belief is a Gaussian — a single bell-shaped cloud. The next lesson breaks even that assumption.

LessonsArcWhat you build on top
4–5Probabilistic foundationsthe Bayes filter; the Kalman filter (optimal linear fusion)
6–8Nonlinear estimationnonlinear models; the E-K-F (tangent line); the U-K-F (sigma points — here)
9–10Beyond Gaussianthe particle filter (clouds of samples, any distribution); multi-hypothesis tracking
11–18Spatial & robust fusionSLAM; visual-inertial odometry; fault detection; covariance intersection
19–22Modern / learneddeep fusion; transformer multimodal fusion; the Sensor Fusion Atlas

Next up, Lesson 9: The Particle Filter — what if your belief isn't a single bell curve at all? What if you're not sure whether the robot is in the kitchen or the hallway — two separate possibilities, a distribution with two humps that no Gaussian (and so neither the E-K-F nor the U-K-F) can represent? The particle filter throws out the Gaussian entirely and tracks a swarm of thousands of weighted samples that can take any shape. The U-K-F's "a few clever points carry the cloud" becomes "many random points are the cloud." It's the most flexible filter of all — and the most expensive.

Related lessons on Engineermaxxing

These existing lessons go deeper on the machinery around the U-K-F:

References

  1. Julier, S. J. and Uhlmann, J. K. "A New Extension of the Kalman Filter to Nonlinear Systems." Proc. SPIE 3068, Signal Processing, Sensor Fusion, and Target Recognition VI, 1997. The paper that introduced the unscented transform and sigma points — the founding U-K-F reference. doi:10.1117/12.280797
  2. Julier, S. J. and Uhlmann, J. K. "Unscented Filtering and Nonlinear Estimation." Proceedings of the IEEE, vol. 92, no. 3, pp. 401–422, 2004. The definitive tutorial synthesis, with the scaled unscented transform and the α/β/κ parameterization. doi:10.1109/JPROC.2003.823141
  3. Wan, E. A. and van der Merwe, R. "The Unscented Kalman Filter for Nonlinear Estimation." Proc. IEEE Adaptive Systems for Signal Processing, Communications, and Control Symposium, 2000. Coins the term "Unscented Kalman Filter" and lays out the predict/update equations used today. doi:10.1109/ASSPCC.2000.882463
  4. van der Merwe, R. and Wan, E. A. "The Square-Root Unscented Kalman Filter for State and Parameter Estimation." Proc. IEEE ICASSP, 2001. The numerically robust SR-U-K-F that keeps the covariance positive definite (Chapter 9's fix). doi:10.1109/ICASSP.2001.940586
A colleague says "the U-K-F is just an E-K-F that uses a few extra sample points instead of one." What's the precise correction?