- Introduced by
- Richard S. Bucy
- Year
- 1961
- Type
- algorithm
- Family
- Nonlinear Estimation
What does it do?
The Extended Kalman Filter (EKF) is a recursive state estimator for nonlinear systems.
It applies the Kalman Filter equations to a model that is linearized locally around the current estimate. It is widely used for real-time estimation from noisy nonlinear sensors and dynamics in robotics, navigation and control. Early work on linear approximations to nonlinear filtering, including Richard S. Bucy's 1961 technical report, is often cited as a starting point, but the attribution of the extended filter as used today is debated.
The intuition behind the method
The linear Kalman Filter is optimal when the system and measurement equations are linear, but many practical problems are not. A range-bearing sensor measures angles and distances rather than the state itself, and motion models often contain trigonometric terms. The EKF handles this by linearizing the nonlinear dynamics and measurement functions around the current estimate: at each step it computes Jacobian matrices (matrices of partial derivatives) at that estimate and applies the linear Kalman Filter equations with those Jacobians. Because the linear approximation is valid only near the estimate, the result is an approximate estimate rather than the optimal one, and errors can build up when the nonlinearity is strong.
History
The filter is linked to Richard S. Bucy, whose 1961 JPL technical report treats linear approximations to the solution of nonlinear filtering equations. That report is early groundwork for nonlinear filtering; the origin of the extended filter in the form commonly implemented today is debated. The book by Bar-Shalom, Li and Kirubarajan covers state estimation for tracking and navigation and is cited here as a textbook treatment. Later variants include the Unscented Kalman Filter, which propagates deterministically chosen sample points instead of linearizing, and the Ensemble Kalman Filter, which is used in large-scale data assimilation.
When to use it
Choose the EKF when the system dynamics or the measurements are nonlinear, the noise is approximately Gaussian, and you need recursive, real-time estimates together with a covariance that quantifies uncertainty. It suits robotics sensor fusion (for example IMU, GPS and encoder data), navigation, and state feedback for nonlinear plants, provided the nonlinearity is mild to moderate and the estimate stays reasonably close to the true state. Use the linear Kalman Filter instead when the model is linear. Avoid the EKF when the nonlinearity is strong, when the noise is clearly non-Gaussian, or when you need guaranteed bounds on estimation error, for which interval methods are more appropriate. If linearization error is the main concern, the Unscented Kalman Filter is the usual alternative.
Limitations and considerations
- The first-order approximation is not corrected: linearization error is not removed, and it can accumulate over successive steps, so the estimate is suboptimal for nonlinear systems.
- Jacobian computation is error-prone; a wrong derivative distorts both the Kalman gain and the covariance update.
- Assumes process and measurement noise are Gaussian and that each measurement function is well approximated by its first-order expansion around the predicted state; strongly curved or non-Gaussian measurements can make the filter diverge.
- Linearization is local: when the estimation error is large relative to the region where the model is nearly linear, the Jacobians describe the wrong region and the update pulls the estimate in the wrong direction.
- Can diverge if the initial estimate is far from the true state or if the model differs substantially from the real system.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Applies the recursive predict-update structure of the Kalman Filter to nonlinear models, so each new measurement is processed without reprocessing earlier data.
- Can run in real time: each cycle requires Jacobian evaluations and matrix operations of fixed size, so the per-cycle cost is predictable and the method is practical for real-time use.
- Well-understood theory with many implementations, so reference code is easy to find and compare against.
- Fuses several nonlinear sensors, such as cameras, lidar and radar, into one state estimate, each entering through its own measurement function.
- Returns a covariance alongside the estimate, so downstream decisions can account for how confident the estimate is.
Applications
- Robotics: mobile robot localization that fuses odometry with landmark observations, and real-time SLAM with noisy sensors.
- Aerospace: aircraft state estimation from inertial and GPS measurements, and spacecraft attitude estimation from star-tracker data.
- Automotive: vehicle localization from wheel encoders and GPS, and state estimation for adaptive cruise control.
- Navigation: inertial measurement unit bias estimation and GPS/INS integration for precise positioning.
- Computer vision: 3D object tracking from video, and visual odometry that combines camera and IMU measurements.
How it works
How it works
Set the initial state estimate x_hat_0 and its covariance P_0. P_0 encodes how uncertain you are about the initial condition; an overconfident P_0 makes the filter slow to correct early errors.
Propagate the state through the nonlinear motion model x_{k+1} = f(x_k, u_k). Evaluate the Jacobian F_k of f at the current estimate and propagate the covariance with P_{k+1|k} = F_k P_k F_k^T + Q, where Q is the process noise covariance.
At each measurement time, evaluate the Jacobian H_k of the measurement function h at the predicted state x_hat_{k|k-1}. This local linear model is the only part of h that the update uses.
Apply the standard Kalman Filter update with H_k. Compute the innovation nu_k = z_k - h(x_hat_{k|k-1}), which is the difference between the actual measurement and its predicted value, and its covariance S_k = H_k P_{k|k-1} H_k^T + R, where R is the measurement noise covariance. Compute the Kalman gain K_k = P_{k|k-1} H_k^T S_k^{-1}, correct the state with x_hat_{k|k} = x_hat_{k|k-1} + K_k nu_k, and update the covariance with P_{k|k} = (I - K_k H_k) P_{k|k-1}.
Common pitfalls
- Computing Jacobians incorrectly (sign errors, missing terms); check each one numerically against finite differences before running the filter.
- Over-tuning or misspecifying the noise covariances Q and R; wrong values can cause divergence or slow convergence, and tuning them to fit one dataset can hide model error.
- Ignoring observability: if some state components are not observable from the measurements, they are never corrected, and their covariance keeps growing.
- Treating the output covariance as exact: linearization error and model mismatch make it optimistic, so the reported confidence can exceed the actual accuracy.
- Assuming Gaussian noise: real sensors often produce outliers, which the filter treats as ordinary innovations and which can pull the estimate off course.
Frequently asked questions
How do I compute the Jacobian matrices for the EKF?
Compute each Jacobian as partial derivatives, F[i,j] = ∂f_i/∂x_j, evaluated at the current estimate. For complicated functions, automatic differentiation tools avoid manual algebra errors. Verify every Jacobian numerically by comparing it with finite-difference approximations of the form (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 propagates a set of deterministically chosen points (sigma points) around the estimate through the nonlinear function, capturing higher-order nonlinearity without explicit Jacobians. The UKF is often more accurate for strongly nonlinear systems but is more computationally expensive.
How do I detect filter divergence?
Monitor the normalized innovation (the measurement residual divided by its predicted covariance). For a consistent filter these innovations should be zero-mean with stable spread; persistent bias or growing variance indicates divergence. A concrete check is the normalized innovation squared, nu_k^T S_k^{-1} nu_k, where nu_k = z_k - h(x_hat_{k|k-1}) and S_k = H_k P_{k|k-1} H_k^T + R. For a consistent filter its time average should match the measurement dimension m, and individual values can be compared with a chi-square threshold with m degrees of freedom. Also watch the predicted covariance: steadily growing uncertainty can come from a large Q, from an unobservable state, or from model mismatch, so the cause should be checked rather than assumed.
Can I use EKF for systems with time delays?
The standard EKF does not handle time delays in measurements, because it assumes each measurement is current. To use it with delayed measurements, augment the state vector to include past states, or use a delayed-measurement Kalman Filter variant that stores and processes out-of-order measurements.
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 referenceBar-Shalom, Y., Li, X. R., & Kirubarajan, T. (2001). Estimation with Applications to Tracking and Navigation. Wiley-Interscience.
Open DOI referenceWelch, G., & Bishop, G. (2006). An Introduction to the Kalman Filter. UNC-CH Technical Report.
Open publication reference