- Predict is the same as before: s⁻ = F s + B u (B u = 0 when there is no input), P⁻ = F P Fᵀ + Q.
- Change ①: predict the reading with the real sensor formula, h(s⁻) = distance from s⁻ to the radar. The innovation ν = z − h(s⁻) (ν is Greek "nu") is how wrong that prediction was.
- Change ②: wherever the filter used H, use the Jacobian HJ, worked out fresh at s⁻ each step.
- The gain, the state correction and the covariance update keep their exact form.
- Along the line to the radar, the update is the fusion rule from lesson 1: the prediction's variance and the radar's variance combine.
Side by side
The state is s, and its predicted position is s⁻ = (x̂⁻, ŷ⁻). The hat means "estimate" and the minus means "before the reading". B u is the effect of a known input, like an encoder step; B u = 0 when there is no input. Here is the linear filter from lesson 3 next to the EKF. The predict step is identical. The update has two changes, marked ① and ②; change ② touches three lines.
S is the variance of the innovation: the prediction's doubt about the reading (slide 3) plus the radar's own noise R. With one radar S is a single number, so S⁻¹ is plain division by S.
Change ①: predict the reading honestly
The innovation ν (Greek "nu") asks "how surprised am I by this reading?" To answer it, the filter needs its best prediction of the reading. For a radar that is the real distance from the predicted position s⁻ = (x̂⁻, ŷ⁻) to the radar, h(s⁻) = √((x̂⁻ − a)² + (ŷ⁻ − b)²) for a radar at (a, b). We have the true formula, so we use it. The tangent is only needed where the filter has to move uncertainty around.
Change ②: the Jacobian, fresh every step
S, K and the new P all push uncertainty through the sensor. That needs a matrix, so they use the tangent: HJ = (x̂⁻ − a)/r̂(ŷ⁻ − b)/r̂00. As the robot moves, the direction to the radar changes, so HJ changes. The filter recomputes it at s⁻ on every step. That is the "extended" part.
(If the motion is nonlinear too, say a car that turns, the same trick applies to predict: s⁻ = f(s) with the real motion formula, and its Jacobian in place of F. In this lesson the motion stays linear.)
One update, with numbers
As on slide 3, the state here is just the position (x, y), so HJ drops its velocity zeros and has two entries. The radar is at the origin. The prediction is s⁻ = (3, 4) with P⁻ = diag(0.25, 0.64) (diag means a matrix with these numbers on the diagonal and zeros elsewhere), as on slide 3. The radar reads z = 5.3 m, with noise variance R = 0.25 (σ = 0.5 m).
The new position is 5.2005 m from the radar: between the predicted 5 m and the measured 5.3 m, and nearer the 5.3 m. The estimate moved mostly in y, because y was less certain and points more along the line to the radar.
Look only along the line to the radar and this is lesson 1's fusion rule. The prediction says 5 m with variance 0.4996; the radar says 5.3 m with variance 0.25. The lesson 1 gain is 0.4996 / 0.7496 = 0.67, so the fused range is about 5 + 0.67 · 0.3 = 5.2 m.
P now has a negative covariance (the sign depends on where the radar is): the ellipse has been squeezed along the line of sight and left wide around the circle, where a range says nothing.
The lab runs this exact update and draws both ellipses. Make R tiny and the new ellipse becomes a thin sliver: the radar pins the distance, but not the direction.
The EKF running, step after step
One update is one step. A real filter runs the loop again and again. Take the simplest case: a robot on a straight rail 5 m from the radar post. The rail is the line y = 5 and the radar sits at the origin, so the state s is one number: the position x along the rail. Each step (1 s) the robot moves about 1 m. The encoder measures that step as u, with σ = 0.5 m of noise, and the radar reads the range with σ = 0.3 m.
At x = 0 the robot passes right in front of the radar. There the range hardly changes when x changes (the slope is 0), so the radar can't help, and the filter's doubt grows for a few steps.
Over the 30 steps in this figure the EKF is off by 0.29 m on average (RMS), dead reckoning by 0.73 m.
Keep reading with the full course
Finish lesson 4 and you will be able to: track a robot from range-only radars with an EKF.
Still locked here:
- The rest of this explanation
- 4 more examples with step-by-step solutions
- Five extra members-only problems with worked solutions
$20 once, lifetime access. Lessons 1 and 2 stay free.
Examples
Example 1 · The full update
s⁻ = (3, 4), P⁻ = diag(0.25, 0.64), radar at the origin, z = 5.3, R = 0.25.

Questions and comments
Stuck on something, or found a mistake? Ask here and I'll answer. You sign in with GitHub.