ν = z − h(s⁻) S = HJ P⁻ HJᵀ + R K = P⁻ HJᵀ S⁻¹ s = s⁻ + Kν P = (I − K HJ) P⁻
Key ideas
- A radar reads r = √(x² + y²): nonlinear, so there is no H.
- The Jacobian HJ = [x/r, y/r, 0, 0] is the tangent's slopes, the stand-in for H.
- Uncertainty passes through it like any matrix: σr² ≈ HJ P HJᵀ.
- EKF = the Kalman filter with ① the real h(s) in the innovation and ② HJ in place of H, recomputed every step.
- Two range sensors pin a 2D position; the EKF fails when the tangent is a poor fit.
- Nonlinear sensors. A GPS reads position through a matrix. A radar reads distance, which neither adds nor flips sign like a matrix would: r(3, 0) + r(0, 4) = 7, but r(3, 4) = 5. A Gaussian pushed through that curve bends, and its mean shifts by about σ²/(2r), worst close to the sensor.
- The Jacobian. Zoom in until the curve looks straight. The slopes ∂r/∂x = x/r and ∂r/∂y = y/r form HJ; at (3, 4) they are 0.6 and 0.8. For a radar at (a, b), use the offsets x − a and y − b. The tangent's error grows with the square of the distance from the estimate.
- Uncertainty through a Jacobian. σr² ≈ HJ P HJᵀ = 0.36 · 0.25 + 0.64 · 0.64 = 0.4996 at (3, 4) with σx = 0.5 m and σy = 0.8 m: 5 m ± 0.71 m. Samples agree when P is small, and disagree when it is not.
- The EKF. Predict unchanged. Update with ① ν = z − h(s⁻) and ② HJ everywhere H was. One update from (3, 4) with z = 5.3 and R = 0.25 moved the estimate to (3.0600, 4.2049), and along the line of sight it matched the lesson 1 fusion rule.
- Range-only tracking. One radar leaves a circle; two leave two mirror points, and the prediction picks one. Stack the readings: z and h(s⁻) get 2 entries, HJ gets 2 rows. With honest R the EKF stayed about 13 m from the truth while dead reckoning drifted 87 m. Tell the filter R is too small and it zigzags (about 21 m).
- When it fails. Big uncertainty compared with the curve's bend, a bad starting guess, weak geometry or an overconfident P. The unscented Kalman filter (UKF) pushes a few sigma points through the real h(s) instead of using a tangent.
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
- 1 more example 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 robot estimate is (8, 6), radar at the origin, σx = σy = 0.5 m, no correlation. Find HJ and σr.
Show solutionHide solution
r = 10, HJ = [0.8, 0.6, 0, 0]. σr² ≈ 0.64 · 0.25 + 0.36 · 0.25 = 0.25, so σr = 0.5 m.
Example 2
Radar at the origin, prediction s⁻ = (6, 8), P⁻ = I, R = 1, reading z = 10.5. Do one EKF update.
Show solutionHide solution
h(s⁻) = 10, ν = 0.5, HJ = [0.6, 0.8]. S = 1 + 1 = 2, K = (0.6, 0.8) / 2 = (0.3, 0.4).
s = (6 + 0.15, 8 + 0.2) = (6.15, 8.2), exactly 10.25 m from the radar.

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