Inferensys

Difference

Extended Kalman Filter vs Unscented Kalman Filter for State Estimation

A technical comparison of EKF and UKF for state estimation in robotics. We analyze linearization error, computational cost, and divergence risk to help sensor integration engineers choose the right filter for highly nonlinear humanoid dynamics.
Risk analyst performing AI risk assessment on laptop, risk matrices visible, casual office risk session.
THE ANALYSIS

Introduction

A data-driven comparison of linearization efficiency versus sampling-based accuracy for real-time state estimation in highly nonlinear robotic systems.

The Extended Kalman Filter (EKF) excels at computational efficiency because it linearizes the system dynamics and measurement models using a first-order Taylor series expansion. For example, in a standard visual-inertial odometry pipeline on a low-power embedded processor, an EKF can complete a full predict-update cycle in under 1 millisecond, making it the default choice for resource-constrained platforms where deterministic latency is critical.

The Unscented Kalman Filter (UKF) takes a fundamentally different approach by propagating a minimal set of carefully chosen sigma points through the true nonlinear functions. This strategy avoids the Jacobian derivation required by the EKF and captures the posterior mean and covariance accurately to the 3rd order (Taylor series) for any nonlinearity. The trade-off is a higher computational cost, typically 2-5x that of an EKF, as it requires multiple forward passes through the process and measurement models per iteration.

The key trade-off: If your priority is deterministic, low-latency execution on an embedded microcontroller with mildly nonlinear dynamics, choose the EKF. If you are estimating the state of a highly dynamic humanoid robot performing aggressive maneuvers where linearization errors cause filter divergence, the UKF's superior accuracy and robustness justify the additional computational load. Consider the UKF when the cost of a state estimation failure—such as a bipedal robot falling—far outweighs the cost of a slightly faster processor.

HEAD-TO-HEAD COMPARISON

Feature Comparison

Direct comparison of key metrics and features for state estimation in nonlinear robotic systems.

MetricExtended Kalman Filter (EKF)Unscented Kalman Filter (UKF)

Nonlinear Accuracy (RMSE)

Higher error (linearization loss)

Lower error (avoids linearization)

Computational Cost (per step)

~O(d^2.4) (Jacobian calc)

~O(d^3) (Sigma point propagation)

Real-Time Latency (d=12 state)

< 1 ms

~2-5 ms

Divergence Risk (High Dynamics)

High (Jacobian singularities)

Low (Statistical linearization)

Implementation Complexity

Moderate (requires derivatives)

High (tuning scaling params)

Best Fit for Humanoid Locomotion

EKF vs. UKF for State Estimation

TL;DR Summary

A quick-look guide to choosing between the computational efficiency of the Extended Kalman Filter and the superior accuracy of the Unscented Kalman Filter for highly nonlinear humanoid and robotic systems.

01

Choose EKF for Computational Efficiency

Best for: Real-time control loops on embedded hardware with limited compute (e.g., 200Hz+ IMU integration).

  • Speed: Typically runs 30-50% faster than a UKF, as it only propagates a single state vector and a Jacobian matrix.
  • Maturity: A 60-year-old algorithm with a vast ecosystem of proven, debugged implementations in C++ and Rust.
  • Trade-off: Linearization errors can cause catastrophic divergence in highly nonlinear dynamics, like bipedal foot-ground contact transitions.
02

Choose UKF for Nonlinear Accuracy

Best for: Systems with severe nonlinearities, such as humanoid orientation estimation during a fall or aggressive manipulation.

  • Accuracy: The unscented transform accurately captures the posterior mean and covariance to the 3rd order (Taylor series) for any nonlinearity, avoiding the 1st-order linearization errors of the EKF.
  • Divergence Risk: Significantly lower risk of filter divergence during rapid dynamic maneuvers, making it safer for unstable bipedal locomotion.
  • Trade-off: Higher computational cost due to propagating 2n+1 sigma points, which can be a bottleneck for high-dimensional state vectors on low-power edge processors.
03

Choose EKF for Well-Behaved Sensors

Best for: Fusing data from sensors with near-linear measurement models, such as GPS, wheel odometry, or joint encoders.

  • Simplicity: The Jacobian-based update is straightforward to derive and tune for standard sensor models.
  • Debugging: Linear assumptions make residual monitoring and consistency checks (e.g., NEES) more intuitive.
  • Trade-off: Performs poorly with highly nonlinear measurements like bearing-only cameras or 3D orientation from magnetometers, where the UKF's sample-based update is far superior.
04

Choose UKF for Sparse or Degenerate Data

Best for: Sensor fusion pipelines that must gracefully handle intermittent data or degenerate geometries (e.g., a monocular camera during pure rotation).

  • Robustness: The sigma-point propagation better represents the true non-Gaussian uncertainty that arises from sparse measurements, preventing premature overconfidence.
  • Initialization: Far more tolerant of poor initial state estimates, as it doesn't rely on a local linearization of the dynamics to converge.
  • Trade-off: Tuning the UKF's scaling parameters (alpha, beta, kappa) requires more expert knowledge than tuning standard EKF noise covariance matrices.
HEAD-TO-HEAD COMPARISON

Accuracy and Divergence Benchmarks

Direct comparison of estimation accuracy, computational cost, and divergence risk for highly nonlinear humanoid dynamics.

MetricExtended Kalman Filter (EKF)Unscented Kalman Filter (UKF)

Divergence Risk (Highly Nonlinear)

High

Low

Linearization Method

1st-Order Taylor (Jacobian)

Unscented Transform (Sigma Points)

Mean Accuracy (3rd-Order Terms)

0% Captured

100% Captured

Computational Cost (Relative)

1x (Baseline)

~3x

Jacobian Derivation

Required (Analytical)

Not Required (Derivative-Free)

Stability During Aggressive Maneuvers

Fragile

Robust

Typical Sensor Fusion Use Case

Smooth trajectories, low dynamics

Legged locomotion, contact-rich tasks

CHOOSE YOUR PRIORITY

When to Choose EKF vs UKF

EKF for Speed

Verdict: The default choice for high-rate sensor pipelines (1kHz+).

EKF linearizes the nonlinear system via a first-order Taylor expansion, requiring only a single Jacobian evaluation per update. This makes it computationally lightweight and ideal for embedded systems with limited clock cycles.

  • Latency: ~50-200 µs per iteration on embedded ARM.
  • Best For: IMU-driven attitude estimation, GPS-INS loosely coupled fusion, and motor current-based state observers where the dynamics are mildly nonlinear.
  • Trade-off: Linearization errors can cause divergence if the system is highly nonlinear or the initial estimate is poor.

UKF for Speed

Verdict: Only if you can afford a ~3-5x compute budget.

UKF propagates a minimal set of deterministically chosen sigma points through the true nonlinear function. This avoids Jacobian derivation but requires 2n+1 function evaluations (where n is state dimension).

  • Latency: ~200-800 µs per iteration for a 15-DOF humanoid state.
  • Optimization: Use square-root UKF formulations to avoid Cholesky decomposition bottlenecks.
  • When to avoid: High-dimensional (>30 state) systems where sigma point propagation becomes a real-time bottleneck.
NONLINEAR ESTIMATION

Technical Deep Dive: Linearization Error vs Sigma-Point Propagation

The core architectural difference between the Extended Kalman Filter (EKF) and the Unscented Kalman Filter (UKF) lies in how they handle nonlinear transformations. The EKF linearizes the nonlinear system using a first-order Taylor series expansion (Jacobian), while the UKF propagates a minimal set of carefully chosen 'sigma points' through the true nonlinear function, capturing the posterior mean and covariance accurately to the 3rd order (Taylor series expansion) for any nonlinearity. This section addresses the most critical engineering questions when choosing between computational efficiency and estimation fidelity in humanoid robot sensor fusion pipelines.

The UKF avoids linearization error by approximating the probability distribution, not the nonlinear function. The EKF linearizes the process and measurement models by calculating Jacobian matrices, which truncates the Taylor series expansion after the first-order term. This introduces significant errors in highly nonlinear dynamics, such as the trigonometric functions in humanoid leg kinematics. In contrast, the UKF selects a deterministic set of sigma points that capture the true mean and covariance of the state distribution. These points are propagated through the actual nonlinear function without approximation. The resulting transformed points accurately represent the posterior distribution up to the 3rd order for Gaussian inputs, eliminating the need to compute complex Jacobians and avoiding divergence caused by severe nonlinearities.

THE ANALYSIS

Verdict

A data-driven decision framework for choosing between the computational efficiency of the EKF and the superior nonlinear accuracy of the UKF in real-time sensor fusion pipelines.

The Extended Kalman Filter (EKF) excels at computational efficiency and deterministic execution because it linearizes the system dynamics using a first-order Taylor series expansion. For example, on a standard ARM Cortex-A72 embedded processor, an EKF update for a 15-state IMU/GNSS fusion problem typically completes in under 50 microseconds. This makes it the default choice for high-rate (1 kHz) proprioceptive state estimation where the dynamics are relatively smooth, such as joint-level velocity filtering in a robotic arm. However, this linearization introduces significant errors when the dynamics are highly nonlinear, such as during the rapid attitude changes of a humanoid robot recovering from a push. In these cases, the Jacobian calculation can become ill-conditioned, leading to a divergence risk that requires careful tuning of process noise covariance.

The Unscented Kalman Filter (UKF) takes a fundamentally different approach by propagating a minimal set of carefully chosen sigma points through the true nonlinear dynamics, avoiding linearization entirely. This results in a third-order accuracy (Taylor series) for Gaussian inputs, compared to the EKF's first-order accuracy. In practice, for a humanoid's 24-DOF whole-body state estimation, a UKF can reduce the root mean square error (RMSE) of the base orientation estimate by 30-40% during aggressive locomotion maneuvers compared to an EKF. The trade-off is computational cost: the UKF requires propagating 2n+1 sigma points, making it roughly 3-5x more computationally expensive per iteration than an EKF for the same state dimension, which can push latency to over 200 microseconds on embedded hardware.

The key trade-off: If your priority is deterministic, low-latency execution on resource-constrained embedded hardware for systems with mild nonlinearities, choose the EKF. If you prioritize estimation accuracy and filter consistency for highly nonlinear dynamics—such as bipedal locomotion, aerial acrobatics, or high-speed legged maneuvers—and can afford the additional computational budget, choose the UKF. Consider a hybrid architecture where an EKF handles high-rate IMU propagation, and a lower-rate UKF corrects for visual or LiDAR updates to balance both constraints.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.