control//state estimation//Kalman filter//extended Kalman filter
The extended Kalman filter is the Kalman filter for systems whose model or sensors are not linear, which in practice means almost every real navigation system. Attitude is a rotation, a heading is an angle that wraps around, a range to a beacon is a square root of squared differences, a GPS reports latitude and longitude on a curved Earth: none of them is \(\cd{F}x\) or \(Hx\). The ordinary Kalman filter needs those straight lines; the extended one draws them locally.
The extended Kalman filter is the Kalman filter for systems whose model or sensors are not linear, which in practice means almost every real navigation system. Attitude is a rotation, a heading is an angle that wraps around, a range to a beacon is a square root of squared differences, a GPS reports latitude and longitude on a curved Earth: none of them is Fx\cd{F}xFx or HxHxHx. The ordinary Kalman filter needs those straight lines; the extended one draws them locally.
It keeps the nonlinear functions where they are exact and linearizes them only where the uncertainty must be propagated. The prediction pushes the estimate through the true model, x^−=f(x^)\cb{\hat x^-}=f(\ca{\hat x})x^−=f(x^), and the predicted reading is h(x^−)h(\cb{\hat x^-})h(x^−). Before the reading in blue, after it in green, the model in violet. The covariance, which cannot go through a nonlinear function in closed form, is carried with the Jacobians of fff and hhh evaluated at the current estimate, which play the roles of F\cd{F}F and HHH for that step only (linearization). Everything else, the gain, the correction, the covariance update, is the ordinary filter.
It is what runs in production. PX4, the open-source drone autopilot, estimates attitude, velocity, position and the biases of its gyroscopes and accelerometers with an extended Kalman filter called EKF2, fusing the inertial unit with GPS, magnetometer, barometer and other sensors. Because each sensor arrives with its own delay, it fuses them on a slightly delayed time horizon from buffered data and then propagates the result to the present with the inertial readings.
The linearization is only as good as the estimate it is taken at. Close to the truth and with modest uncertainty, the straight line is a good fit; far from it, or with a strongly curved function inside the spread of P\ca{P}P, the Jacobians point the wrong way, the estimate becomes biased and P\ca{P}P overconfident, and the filter can diverge. A good initialization matters more than in the linear case.
Jacobians are derived by hand or by symbolic tools, and an error in one of them does not crash anything: the filter just performs worse, which makes such errors hard to find. Checking them numerically against finite differences is cheap insurance.
When the functions are too curved for a single tangent, or deriving Jacobians is impractical, the unscented Kalman filter propagates a few chosen points through the exact functions instead.