Extended Kalman Filter
- Introduced by
- Richard S. Bucy
- Year
- 1961
- Type
- algorithm
- Family
- Nonlinear Estimation
What does it do?
The Extended Kalman Filter (EKF) is the nonlinear generalization of the Kalman Filter, extending the linear state estimation algorithm to nonlinear systems through local linearization.
Developed by Bucy in the early 1960s, the EKF has become the workhorse for state estimation in nonlinear systems across robotics, aerospace, and navigation, enabling real-time processing of noisy measurements from nonlinear sensors and dynamics.
The intuition behind the method
The Kalman Filter is optimal for linear systems, but real systems are often nonlinear (robot sensors measure angles, not states; navigation involves trigonometric relationships). The EKF extends the linear Kalman Filter by linearizing the nonlinear system dynamics and measurement equations around the current state estimate. At each time step, the EKF computes Jacobian matrices (partial derivatives) of the nonlinear functions, then applies the standard linear Kalman Filter equations using these Jacobians. The result is a locally optimal estimate that handles moderate nonlinearities well, though it loses the global optimality guarantee of the linear Kalman Filter.
History
Bucy developed the EKF in 1961 as an extension of the Kalman Filter to nonlinear systems. The method was quickly adopted for spacecraft navigation (Apollo program) and aircraft control. Battin and others refined the numerical implementation for embedded systems. Bar-Shalom's textbook (2001) became the standard reference. Modern variants include the Unscented Kalman Filter (UKF), which uses deterministic sampling instead of linearization, and the Ensemble Kalman Filter (EnKF), used in large-scale data assimilation.
When to use it
Use the EKF when you have a nonlinear system and want real-time state estimation from noisy measurements. It is ideal for robotics (sensor fusion of IMU, GPS, encoder data), navigation (aircraft inertial measurement units), and control systems (state feedback on nonlinear plants). The EKF works well for systems with mild to moderate nonlinearities and Gaussian noise. Avoid EKF if the system is highly nonlinear (strong curvature), if noise is non-Gaussian, or if you need guaranteed bounds on estimation error (use interval methods).
Limitations and considerations
- Suboptimal for nonlinear systems; linearization introduces approximation errors that accumulate.
- Jacobian computation can be error-prone; numerical errors in derivatives degrade performance.
- Assumes Gaussian noise and linear measurement equations; non-Gaussian or strongly nonlinear measurements cause filter divergence.
- Local linearization only; breaks down for large state perturbations away from the estimate.
- Can diverge if the initial guess is too far from the true state or if model mismatch is large.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Extends the optimality and recursive efficiency of Kalman filtering to nonlinear systems.
- Real-time implementation possible; scales well to high-dimensional systems (used in automotive and aerospace).
- Well-understood theory and abundant implementations; mature software ecosystem.
- Can fuse multiple nonlinear sensors (camera, lidar, radar) into a unified state estimate.
- Provides state covariance estimate, enabling decision-making based on confidence in the estimate.
Applications
- Robotics: Mobile robot localization fusing odometry and landmark observations, real-time SLAM with noisy sensors.
- Aerospace: Aircraft state estimation from IMU and GPS (sensor fusion), spacecraft attitude estimation from star trackers.
- Automotive: Vehicle localization from wheel encoders and GPS, adaptive cruise control state estimation.
- Navigation: Inertial measurement unit (IMU) bias estimation, GPS/INS integration for precise positioning.
- Computer vision: 3D object tracking from video, visual odometry combining camera and IMU measurements.
How it works
How it works
Set the initial state estimate x_hat_0 and covariance estimate P_0; these reflect your uncertainty about the initial condition.
Use the nonlinear motion model x_{k+1} = f(x_k, u_k) to predict the next state; compute Jacobian F_k of f and propagate covariance using P_{k+1|k} = F_k P_k F_k^T + Q.
At each measurement time, compute the Jacobian H_k of the measurement function h around the predicted state x_hat_{k|k-1}.
Apply the standard Kalman Filter update: compute Kalman gain K_k, update state estimate x_hat_{k|k}, and update covariance P_{k|k}.
Common pitfalls
- Computing Jacobians incorrectly (sign errors, missing terms); always verify numerically against finite differences.
- Over-tuning noise covariances Q and R; misspecified noise statistics cause filter divergence or slow convergence.
- Ignoring observability; if the system is not observable, the filter gains become unreliable and estimates diverge.
- Assuming Gaussian distributions; real sensor noise often has outliers, causing the filter to be misled.
Frequently asked questions
How do I compute the Jacobian matrices for the EKF?
Compute the Jacobian by taking partial derivatives: F[i,j] = ∂f_i/∂x_j evaluated at the current estimate. For complex functions, use automatic differentiation tools (e.g., PyTorch, JAX) to avoid errors. Always verify numerically by comparing against finite difference approximations: (f(x+ε)-f(x))/ε.
What is the difference between EKF and UKF?
The EKF linearizes the nonlinear function using a Taylor expansion (Jacobian). The UKF instead samples a set of deterministically chosen points (sigma points) around the estimate and propagates these through the nonlinear function, capturing higher-order nonlinearity without explicit Jacobians. UKF is often more accurate for strongly nonlinear systems but slightly more computationally expensive.
How do I detect filter divergence?
Monitor the normalized innovation (measurement residual divided by predicted measurement covariance). For a well-tuned filter, these innovations should be white (mean zero, constant variance). If innovations are consistently biased or have increasing variance, the filter is diverging. Also check that predicted covariance decreases over time; if it increases, the model uncertainty Q is too large.
Can I use EKF for systems with time delays?
Standard EKF does not handle time delays in measurements. To use EKF with delayed measurements, augment the state vector to include past states, or use a delayed Kalman Filter variant that stores and processes out-of-order measurements. Another approach is to increase measurement noise covariance R to account for the delay uncertainty.
Related methods
Sources
Bucy, R. S. (1961). A linear approximation to the solution of nonlinear filtering equations. Technical Report No. 32-486, Jet Propulsion Laboratory.
Open publication referenceCopied.Bar-Shalom, Y., Li, X. R., & Kirubarajan, T. (2001). Estimation with Applications to Tracking and Navigation. Wiley-Interscience.
Open DOI referenceCopied.Welch, G., & Bishop, G. (2006). An Introduction to the Kalman Filter. UNC-CH Technical Report.
Open publication referenceCopied.