THE EXTENDED KALMAN FILTER

The Kalman filter for a curved world: when the motion f and the measurement h are nonlinear, the EKF linearizes them at the current estimate through their Jacobians F, H, then runs the ordinary Kalman predict and update on that local linear model. Rendered, not quoted — the engine below computes every gain and covariance live.

source Schmidt, S. F. — Application of State-Space Methods to Navigation Problems, Advances in Control Systems, Vol. 3 (1966), pp. 293–340; the EKF that flew the Apollo onboard navigator. Semantic Scholar amber · book chapter, no open DOI

Blue Team · builds & defends
3

The Model

State x = [px, py, vx, vy]. Motion is linear constant-velocity f(x)=F·x; the measurement is nonlinear: the range to a fixed beacon, h(x)=√((px−bx)²+(py−by)²).

predict: x ← f(x) P ← F P Fᵀ + Q update: y = z − h(x) S = H P Hᵀ + R K = P Hᵀ S⁻¹ x ← x + K y P ← (I−KH) P (I−KH)ᵀ + K R Kᵀ

F = ∂f/∂x and H = ∂h/∂x are the Jacobians evaluated at the current estimate — that single linearization is the whole idea. The update uses the Joseph form, which keeps P symmetric and positive-semidefinite by construction.

5

The Lineage

Neighbour: the-kalman — the linear filter, optimal when f and h are already straight lines. The EKF is that same recursion wrapped around a moving tangent plane: linearize at the estimate, then filter.

On a genuinely linear system the Jacobians are the constant system matrices and the EKF collapses exactly back onto the Kalman filter — the Witness checks this to 1e−9. Downstream it is the workhorse behind GPS, inertial navigation, and every robot pose estimator.

7

The Witness

Live re-check of the running engine — re-runs the invariant proof and inspects the current filter state. It confirms in accent, and flips red the instant the Tamper (window 6) swaps the true Jacobian for the identity.

witness idle…
The Machine
4

Data In in ↓

A prior estimate x₀ and covariance P₀, the process/measurement noise Q, R, and a stream of noisy range readings z from four beacons that surround the target at the corners of a 10×10 field. Truth follows a slow constant-velocity path inside that field. Noise is drawn from a fixed-seed PRNG (mulberry32, seed 12345) so every run is identical.

↓ linearize & filter ↓
0

The Panel lit

The EKF running live — the two Jacobians it forms this step, the gain that weighs them, and the tracked state against the hidden truth.

Motion Jacobian F = ∂f/∂x
Measurement Jacobian H = ∂h/∂x
Kalman gain K (last update)
Tracked state vs. truth
booting…
↓ proven result ↓
8

Data Out out ↓

What the engine proves, not asserts: on a linear system EKF ≡ KF to 1e−9; the covariance stays symmetric and positive-semidefinite; the gain trusts the measurement fully as R→0 and ignores it as R→∞; and on the nonlinear range problem the estimate tracks truth with bounded error.

Red Team · attacks & breaks
1

The Adversary wall

The EKF keeps only the first-order term of f and h. It carries no optimality guarantee — that belongs to the linear Kalman filter alone.

Where the truth curves faster than the tangent plane can follow — sharp turns, large covariance, a bad initial guess — the linearization error feeds back and the filter can diverge and never recover. A collapsing P (too little Q) makes it smug: it stops listening to measurements and coasts on a stale velocity. These are the walls the UKF and particle filter were built to climb.

2

The Graveyard

  • The EKF is the optimal nonlinear estimator.
    Only the linear KF is optimal. The EKF is a first-order approximation; it is biased and can be beaten by the UKF or a particle filter on strong nonlinearity.
  • If it runs, it converges.
    It can diverge under strong curvature, poor initialization, or an over-confident covariance. Convergence must be checked, never assumed.
  • You can skip the Jacobian and just use H = I.
    That applies the wrong correction and the estimate walks away from the truth — exactly the planted fault in window 6.
6

The Tamper

Disclosed planted void: replace the measurement Jacobian H with the identity on px — skip the linearization entirely. The innovation still uses the true range, but the gain now corrects the wrong states, so the estimate diverges. The Witness (7) catches it live.