Moving Horizon Estimation (MHE) is an advanced, optimization-based state estimation technique. It determines the most probable sequence of past system states by solving a constrained optimization problem over a finite, moving window of recent measurements. Unlike recursive filters like the Kalman Filter, MHE explicitly handles nonlinear system dynamics, hard constraints on states and disturbances, and can directly incorporate prior knowledge, making it robust for complex, constrained systems common in robotics and process control.
Glossary
Moving Horizon Estimation (MHE)

What is Moving Horizon Estimation (MHE)?
Moving Horizon Estimation (MHE) is the dual problem to Model Predictive Control (MPC), solving a constrained optimization over a finite window of past measurements to determine the most likely current system state.
The core MHE algorithm minimizes a cost function balancing measurement error and model prediction error, often including a prior weighting or arrival cost to summarize information before the estimation horizon. At each time step, the oldest measurement is discarded and a new one is added, and the optimization is re-solved. This explicit handling of constraints and nonlinearities makes MHE computationally more intensive than recursive methods but provides superior accuracy and guaranteed constraint satisfaction for critical embodied intelligence systems where precise state knowledge is essential for control.
Key Features of Moving Horizon Estimation
Moving Horizon Estimation (MHE) is the dual problem to Model Predictive Control (MPC). It solves a constrained optimization problem over a finite window of past measurements to determine the most likely current system state, explicitly handling nonlinearities and constraints.
Finite Horizon Optimization
Unlike the Kalman Filter, which uses all past data, MHE solves an optimization problem over a sliding window of the most recent N measurements. This window, the estimation horizon, moves forward in time with each new measurement. The core optimization minimizes the discrepancy between model predictions and measurements within this window, plus a prior weighting term that incorporates information from before the horizon. This structure provides a natural mechanism for data forgetting, preventing outdated information from corrupting the current estimate.
Explicit Constraint Handling
A primary advantage of MHE is its ability to enforce hard constraints on state and parameter estimates. These constraints encode physical realities and prior knowledge that a pure statistical filter cannot guarantee.
- Physical Limits: Enforce that a tank level must be between 0% and 100%, or a concentration must be non-negative.
- Model-Based Knowledge: Constrain parameters like reaction rates to known feasible ranges.
- Feasibility Guarantees: The optimization ensures the estimated state trajectory is consistent with both the measurements and the system's physical operating envelope, leading to more realistic and reliable estimates than unconstrained methods.
Natural Handling of Nonlinearities
MHE formulates estimation as a Nonlinear Programming (NLP) problem, allowing it to directly incorporate nonlinear dynamic models. This is critical for complex systems like chemical reactors, robotics, and aerospace vehicles where dynamics are inherently nonlinear.
The optimization framework does not require linearization for the core algorithm (though solvers may use it internally). It seeks the state trajectory that best fits the nonlinear model to the data. This makes MHE more accurate than the Extended Kalman Filter (EKF) for highly nonlinear systems, as it avoids the linearization errors that can accumulate in the EKF's recursive update.
The Arrival Cost & Prior Information
The arrival cost is a critical term in the MHE objective function that summarizes the information from measurements prior to the estimation horizon. It prevents the loss of historical data when the window slides.
- Function: It penalizes estimates at the beginning of the horizon that are inconsistent with past data.
- Approximation: Often approximated using the covariance from a Kalman Filter or an Extended Kalman Filter (EKF), effectively "bridging" the recursive filtering world with the optimization-based MHE framework.
- Stability: A well-designed arrival cost is essential for guaranteeing the stability of the MHE, ensuring estimates do not diverge.
Dual to Model Predictive Control
MHE is the natural dual or inverse problem of Model Predictive Control (MPC). This duality creates a powerful, symmetric framework for advanced control:
- MPC (Forward Problem): Uses a model to predict future states and optimize future control inputs.
- MHE (Inverse Problem): Uses a model and past measurements to reconstruct past states and estimate current states.
In practice, they are often used in tandem: MHE provides the accurate initial state estimate required for MPC's prediction. This MPC-MHE cascade is the standard architecture for high-performance constrained control of complex systems, such as autonomous vehicles and chemical processes.
Computational Demand & Real-Time Viability
The main challenge of MHE is its computational cost. At each time step, it must solve a (potentially large) Nonlinear Programming problem within the system's sampling period.
- Solvers: Relies on efficient NLP solvers like IPOPT or Sequential Quadratic Programming (SQP) methods.
- Optimization: Techniques like direct multiple shooting or collocation discretize the problem for numerical stability.
- Real-Time: Advances in solver speed and warm-starting (using the previous solution as an initial guess) have made real-time MHE feasible for many industrial applications with sampling times on the order of seconds. For very fast systems, Explicit MHE or approximate methods may be required.
MHE vs. Kalman Filter: A Comparison
A technical comparison of two fundamental state estimation methods, highlighting their core principles, computational characteristics, and suitability for different classes of problems in control and robotics.
| Feature / Metric | Moving Horizon Estimation (MHE) | Kalman Filter (and EKF/UKF) |
|---|---|---|
Core Mathematical Formulation | Finite-horizon constrained optimization problem (NLP/QP) | Recursive Bayesian filter (linear-Gaussian or approximations) |
Primary Output | Optimal sequence of past states over a horizon, plus current state estimate | Optimal current state estimate (and covariance) |
Explicit Constraint Handling | ||
Inherent Nonlinearity Handling | Direct (via Nonlinear Programming) | Approximated (Extended KF) or Sampled (Unscented KF) |
Theoretical Foundation | Optimal control / Optimization theory | Statistical estimation / Probability theory |
Computational Complexity | High (solves optimization online) | Low (closed-form matrix operations) |
Memory Requirement | Grows with horizon length N | Fixed (state covariance matrix) |
Typical Use Case | Process control, chemical reactors, systems with hard constraints | Tracking, navigation, systems with soft or no constraints |
Robustness to Bad Initial Guess | High (optimization can recover) | Low (can diverge) |
Tuning Parameters | Horizon length N, weighting matrices, constraint bounds | Process & measurement noise covariance matrices (Q, R) |
Online Computation Time | ~1 ms to >1 sec (problem-dependent) | < 1 ms (typically) |
Guarantees with Nonlinear Models | Convergence to local optimum (with proper NLP solver) | No formal guarantees (EKF/UKF are heuristics) |
Treatment of Outliers | Explicit via constraints or robust cost functions | Poor (assumes Gaussian noise) |
Applications and Use Cases
Moving Horizon Estimation (MHE) is the dual problem to Model Predictive Control (MPC), solving a constrained optimization over a finite window of past data to estimate the current state of a dynamic system. Its explicit handling of constraints and nonlinear models makes it indispensable for high-performance control in complex, real-world environments.
Frequently Asked Questions
Moving Horizon Estimation (MHE) is the state estimation counterpart to Model Predictive Control (MPC). These questions address its core principles, implementation, and role in modern control systems.
Moving Horizon Estimation (MHE) is an advanced, optimization-based state estimation technique that determines the most likely sequence of past system states by solving a constrained optimization problem over a finite, sliding window of recent measurements.
It works by:
- Maintaining a Horizon: Using a buffer of the most recent
Ntime steps of sensor measurements and known control inputs. - Solving an Optimization: At each new time step, it formulates and solves a Nonlinear Programming (NLP) problem. This problem minimizes a cost function that penalizes the discrepancy between predicted and actual measurements, as well as the deviation of the estimated initial state in the horizon from a prior prediction.
- Applying Constraints: It explicitly enforces the system's dynamic model and can incorporate hard bounds on estimated states (e.g., a robot's joint angles cannot exceed physical limits), which traditional filters like the Kalman Filter cannot do directly.
- Moving the Window: After solving, the horizon "moves" forward by one step, discarding the oldest data and incorporating the newest measurement, and the process repeats.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Moving Horizon Estimation (MHE) is a cornerstone of modern control systems. These related concepts define the mathematical, computational, and practical ecosystem in which MHE operates.
Model Predictive Control (MPC)
Model Predictive Control (MPC) is the dual problem to MHE. It is an advanced control method that uses an internal dynamic model to predict future system behavior over a finite horizon. At each time step, it solves an online optimization problem to determine a sequence of optimal control inputs, applying only the first input before re-solving with new measurements.
- Core Principle: Receding horizon control.
- Mathematical Foundation: Optimal Control Problem (OCP).
- Key Relationship to MHE: MPC requires an accurate initial state for its predictions, which is precisely the output provided by MHE. Together, they form an MHE-MPC cascade, the gold standard for constrained, nonlinear control.
Kalman Filter (KF)
The Kalman Filter (KF) is the foundational recursive algorithm for state estimation in linear dynamic systems with Gaussian noise. It provides the optimal (minimum mean-square error) state estimate by fusing predictions from a model with incoming measurements.
- Key Limitation: Designed for unconstrained, linear systems.
- Contrast with MHE: MHE generalizes the KF by explicitly handling nonlinear dynamics, hard constraints on states, and using a finite window of past data. For linear, unconstrained problems, the KF and a properly tuned MHE yield identical results, but MHE provides a unified framework for more complex scenarios.
Extended Kalman Filter (EKF)
The Extended Kalman Filter (EKF) is the de facto standard for nonlinear state estimation. It linearizes the system's nonlinear dynamics and measurement models around the current state estimate at each time step, then applies the standard Kalman Filter equations.
- Primary Use Case: Real-time estimation for moderately nonlinear systems.
- Contrast with MHE: The EKF's linearization can introduce significant errors for highly nonlinear systems or when estimates approach constraints. MHE solves a full nonlinear optimization over a data window, providing more accurate estimates for constrained, strongly nonlinear problems, albeit at a higher computational cost.
Optimal Control Problem (OCP)
An Optimal Control Problem (OCP) is the core mathematical formulation solved by both MPC and MHE. It is defined by:
-
A cost function (or objective function) to be minimized.
-
A dynamic model describing the system's evolution.
-
A set of constraints on states and inputs.
-
A specified time horizon.
-
In MPC: The OCP is solved forward in time to find optimal future controls.
-
In MHE: The OCP is solved over a recent past horizon to find the most likely sequence of past states that explains the observed measurements, given the model and constraints. MHE is essentially an OCP for estimation.
Full Information Estimation (FIE)
Full Information Estimation (FIE) is the theoretical ideal where the optimization for state estimation considers the entire history of measurements from time zero to the current time. It provides the best possible estimate but grows computationally unbounded over time.
- Key Relationship to MHE: MHE is a practical approximation of FIE. Instead of using all past data, MHE uses a fixed-length moving window of the most recent measurements. This imposes a finite, manageable problem size while retaining most of the performance benefits of FIE, especially for systems where older data becomes less informative.
Arrival Cost
The Arrival Cost is a critical term in the MHE cost function that summarizes the information from data outside the estimation window. It penalizes the estimated state at the beginning of the window based on all prior measurements, ensuring the finite-horizon MHE problem approximates the full-history FIE problem.
- Function: Prevents the loss of historical information as the window slides.
- Common Approximation: Often approximated using the covariance matrix from a standard Kalman Filter or EKF running in parallel. The accurate design and approximation of the arrival cost is essential for MHE stability and performance.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us