3.5.24 · D2Guidance, Navigation & Control (GNC)

Visual walkthrough — Extended Kalman Filter (EKF) — linearization, Jacobians

2,966 words13 min readBack to topic

Prerequisites we lean on (build them if rusty): Taylor Series & Linearization, Jacobian Matrix & Multivariable Calculus, Covariance Propagation. This is the visual companion to the EKF parent note.


Step 1 — A curve, and one point we trust

WHAT. Start with the simplest honest picture: a single nonlinear measurement function (the sensor rule from the box above). Imagine a radar whose reading depends on target position through a curved rule. We draw that rule as a black curve. We also have one thing we believe: our current best estimate, a single dot on the input axis called ("x-hat", the hat means estimate).

WHY. The EKF never trusts the whole curve at once — that would be impossible, the curve is infinitely varied. It trusts only a small neighbourhood around the one point it currently believes. So the first act of the whole derivation is: pick the point of trust.

PICTURE. The red dot is ; the black curve is the measurement map . Everything downstream happens around the red dot.

Figure — Extended Kalman Filter (EKF) — linearization, Jacobians

Step 2 — Zoom in until the curve looks straight

WHAT. Take a microscope to the curve at . Zoom in once, then again. The more we zoom, the flatter the curve looks — until, in a tiny window, it is visually indistinguishable from a straight line.

WHY. This is the entire secret of the EKF in one observation: any smooth curve, seen closely enough, is a line. That is not a trick — it is the definition of "smooth." If we only ever ask about states very close to , we may as well replace the curve by that local line and lose almost nothing.

PICTURE. Three panels, each a deeper zoom on the same red point. Watch the black curve flatten.

Figure — Extended Kalman Filter (EKF) — linearization, Jacobians

Step 3 — Name the line: value + slope × step

WHAT. We now write down the straight line that hugs the measurement curve at . A line needs two numbers: where it starts and how steep it is.

Term by term, exactly where it appears:

  • — the curve's actual height at the anchor. Where the tangent line touches.
  • — the slope: how many units the output rises per unit the input moves, measured right at .
  • — how far we stepped away from the anchor. Zero at the anchor, so the line touches the curve there.

WHY this tool and not another. We could have fit a parabola or a whole polynomial. We deliberately stop at the line (first order) because the Kalman machinery only knows how to move Gaussians through constant matrices — a line's slope is a constant. This is the first-order Taylor expansion, and "first order" is chosen precisely because it is the highest order the linear KF can consume.

PICTURE. The red tangent line laid over the black curve, with the height and slope labelled on the figure.

Figure — Extended Kalman Filter (EKF) — linearization, Jacobians

Step 4 — From one slope to a whole matrix: the Jacobian

WHAT. Real states are not one number. A target has and ; the radar returns range and bearing. So the input is a vector and the output is a vector. The single slope must become a grid of slopes: one for every (output, input) pair. That grid is the Jacobian of the measurement map, called .

Reading the grid — this is the whole idea of the Jacobian:

  • A row = one output. Top row = "how range responds"; it lists range's sensitivity to each input.
  • A column = one input. Left column = "what nudging does"; it lists every output's response to .
  • Entry = = the slope of output if you jiggle only input .

WHY. With two inputs, the tangent "line" becomes a tangent plane for each output. A plane still needs just its slopes along each axis — and those slopes are exactly the partial derivatives sitting in the Jacobian. The Jacobian is the best constant matrix that reproduces the curve's local behaviour, which is precisely what the KF demanded.

PICTURE. A curved surface (range over the plane) with the flat red tangent plane kissing it at ; the two axis-slopes are the two entries of the top Jacobian row.

Figure — Extended Kalman Filter (EKF) — linearization, Jacobians
Recall Check the reading direction

In for range/bearing, what does the entry in row 1, column 2 mean? ::: — how much the range changes when only moves. Row picks the output (range), column picks the input ().


Step 5 — Switch to the transition curve and its slope

WHAT. So far the black curve was the measurement map . Now we do the identical tangent construction on the other curve — the state-transition map from the top box, which carries (last tick) to the next state. Its tangent slope, built exactly as in Steps 3–4, is the transition Jacobian

Every symbol: — the grid of slopes of the transition rule (not the sensor); the bar — "evaluated at last tick's estimate," because that is where the motion starts.

WHY. We need before we can talk about how the belief cloud spreads while it moves forward one tick. The geometry is not new — it is Step 3's "value + slope × step" applied to instead of .

PICTURE. The same tangent idea, now labelled on the transition curve : black curve , red tangent whose slope is , anchored at .

Figure — Extended Kalman Filter (EKF) — linearization, Jacobians

Step 6 — Push a cloud, not a point, through the transition curve

WHAT. Our belief is never a single dot — it is a fuzzy cloud (a Gaussian) centred at , whose width is the covariance . Watch what happens when this cloud crosses the transition curve two different ways:

  1. Through the true curve (top path): the cloud comes out bent and lopsided — no longer a clean Gaussian. The KF equations cannot describe a skewed blob.
  2. Through the red tangent line (slope , bottom path): a straight line only stretches and shifts a Gaussian — it stays a perfect Gaussian. Now the KF can handle it.

WHY. This is the reason the tangent line exists at all. Propagating covariance requires the map to be linear so that "Gaussian in ⇒ Gaussian out." The curve breaks that promise; the tangent keeps it. We knowingly trade a little accuracy (the curve's bend) for a Gaussian we can actually compute with.

PICTURE. Same input cloud , two exits: bent (curve ) vs. clean (tangent, slope ).

Figure — Extended Kalman Filter (EKF) — linearization, Jacobians

Step 7 — The split personality: mean nonlinear, covariance linear

WHAT. Here is the subtlety the parent note flagged. When we step the filter forward one tick:

  • the centre of the cloud is moved by the true curve — because the best guess of the next state is the honest function of the current best guess;
  • the width of the cloud is moved by the Jacobian — because only a straight map keeps a Gaussian Gaussian.

WHY. Using the curve for the centre costs nothing (a single point can follow any curve exactly). Using the curve for the width is impossible to keep Gaussian. So we route each object through whichever map it can survive.

PICTURE. One arrow labelled "centre" following the black curve ; a second pair of arrows labelled "width" following the red tangent (slope ) — diverging slightly, which is exactly the approximation error.

Figure — Extended Kalman Filter (EKF) — linearization, Jacobians

Step 8 — Where the tangent is drawn matters: the two evaluation points

WHAT. The slope of a curve is different at every point. So at which point we draw the tangent decides which slope we get. The EKF uses two different anchors on two different curves:

  • (transition slope) is drawn on curve at the previous estimate — because that is where the motion starts.
  • (measurement slope) is drawn on curve at the predicted estimate — because the measurement is compared against where we predict we are now.

WHY. Draw the tangent at the wrong point and its slope is wrong, so and are wrong, so the whole filter drifts. The curve's steepness genuinely changes along it — there is no single "the slope."

PICTURE. The same curve with two red dots at two different states and two clearly different-steepness tangents — showing that "the Jacobian" is meaningless without "evaluated where."

Figure — Extended Kalman Filter (EKF) — linearization, Jacobians

Step 9 — The degenerate case: where the tangent lies

WHAT. Two dangerous situations, each its own picture:

  1. Flat spot (a slope ). At a point where a curve momentarily levels off, its tangent slope is nearly zero. The tangent says "the output barely responds to this input," yet a small move might land on a steep part. Example on the transition curve: the pendulum's transition Jacobian entry vanishes at — the restoring stiffness disappears exactly where the linear model claims it is constant. (Note this is a slope of , not of — same flat-spot geometry, transition curve.)
  2. Far anchor. If is far from the truth, the tangent drawn there points off in a wrong direction entirely; the cloud gets stretched the wrong way and the filter diverges.

WHY. The tangent only tells the truth near its anchor and when the curve is genuinely gentle there. Both failures are the same failure — trusting the line outside the flat window of Step 2.

PICTURE. Left: a flat-spot tangent that badly mis-predicts the nearby steep curve. Right: a far-off anchor whose tangent misses the true state completely (divergence).

Figure — Extended Kalman Filter (EKF) — linearization, Jacobians

The one-picture summary

Everything above, compressed: a Gaussian cloud sits at on a black curve; the red tangent line (slope = Jacobian) replaces the curve locally; the centre follows the true curve while the width follows the tangent, producing a clean Gaussian we feed to the linear Kalman equations. The table locks in which curve and which Jacobian belong to which phase.

phase curve used for centre Jacobian used for width evaluated at
predict (transition)
update (measurement)
Figure — Extended Kalman Filter (EKF) — linearization, Jacobians
Recall Feynman retelling — say it in plain words

Imagine you're walking along a bumpy mountain road in fog, and you can only trust the ground right under your feet. That patch of ground looks flat even though the whole mountain is curved — that flat patch is the tangent, and how tilted it is, is the Jacobian. There are actually two different mountains: one is the motion mountain (how your position rolls forward each second, tilt ), the other is the sensor mountain (how your instruments read out your position, tilt ). You keep a fuzzy sense of where you might really be (a cloud, the covariance ). When you take a step forward in time, you move the centre of your guess along the real curvy motion road — because your best single guess can follow any road exactly. But your fuzziness you only stretch using the flat tilt under your feet, because a straight tilt keeps the fuzz nicely bell-shaped and math-friendly, while the real curve would smear it into an ugly lopsided blob nobody can compute with. That gives the predicted cloud , the "minus" meaning "moved but not yet corrected." The one rule you must never break: draw your flat patch under the foot you're standing on right now — on the motion mountain at last tick for , on the sensor mountain at the predicted spot for . And if the road bends violently, or you started way off the road, the flat patch is a lie and you either fall (diverge) or you switch to a smarter scout that samples several points on the real road — the UKF.