Inferensys

Glossary

Moving Horizon Estimation (MHE)

An optimization-based state estimation technique that uses a sliding window of past measurements and a dynamic model to estimate the current state while respecting physical constraints.
Engineer optimizing context window usage on laptop, token usage charts visible, technical work session.
CONSTRAINED STATE ESTIMATION

What is Moving Horizon Estimation (MHE)?

Moving Horizon Estimation (MHE) is an optimization-based state estimation technique that reformulates the estimation problem as a constrained optimization over a finite, receding window of past measurement data and a dynamic process model.

Moving Horizon Estimation (MHE) is an optimization-based state estimation technique that uses a finite, sliding window of past sensor measurements and a dynamic process model to compute the most probable current system state. Unlike recursive filters, MHE explicitly incorporates physical constraints—such as non-negative concentrations or valve saturation limits—directly into the estimation problem, solving a constrained optimization at each time step to ensure physically meaningful state estimates.

MHE operates by maintaining a history of N past measurements and solving a nonlinear program that minimizes the error between predicted and actual measurements over this horizon. The oldest data point is discarded as a new measurement arrives, creating a receding horizon. This formulation allows MHE to handle nonlinear dynamics and non-Gaussian noise while respecting hard constraints, making it particularly valuable in Model Predictive Control (MPC) frameworks for chemical processes and autonomous systems where constraint violation is unacceptable.

CONSTRAINED STATE ESTIMATION

Key Characteristics of MHE

Moving Horizon Estimation (MHE) is an optimization-based state estimation technique that uses a sliding window of past measurements and a dynamic model to estimate the current state while respecting physical constraints.

01

Receding Horizon Formulation

MHE maintains a fixed-size window of the most recent N measurements. At each time step, the oldest measurement is discarded and the newest is added. The estimator solves a constrained optimization problem over this window to find the state trajectory that best fits the measurements and the dynamic model.

  • Window length N trades off computational load against smoothing quality
  • Longer windows incorporate more data for better disturbance rejection
  • Shorter windows reduce solve time for real-time execution
  • The horizon recedes as time advances, hence the name
02

Arrival Cost Approximation

The arrival cost summarizes all information from measurements older than the current horizon window into a single penalty term. This prevents information loss when old data leaves the window.

  • Approximated using an Extended Kalman Filter (EKF) covariance update
  • Encodes the prior belief about the state at the start of the horizon
  • Critical for stability—an inaccurate arrival cost can cause divergence
  • For linear unconstrained systems, MHE with exact arrival cost reduces to the Kalman filter
03

Explicit Constraint Handling

Unlike Kalman filters, MHE naturally incorporates physical and operational constraints directly into the estimation problem. This is its primary advantage in industrial applications.

  • Hard constraints: x_min ≤ x_k ≤ x_max enforces physical limits like valve saturation
  • Rate constraints: |x_k - x_{k-1}| ≤ Δ_max prevents unrealistic state jumps
  • Non-negativity: concentrations and pressures cannot go negative
  • Constraints are enforced as inequalities in the nonlinear program (NLP) solver
04

Full Nonlinear Dynamics

MHE directly uses the nonlinear process model x_{k+1} = f(x_k, u_k) + w_k without linearization in the optimization. This captures complex behaviors like chemical reaction kinetics and phase changes.

  • Handles nonlinear state transitions that EKF linearization would distort
  • Accommodates non-Gaussian noise distributions through custom cost functions
  • The measurement model y_k = h(x_k) + v_k can also be fully nonlinear
  • Requires a nonlinear programming solver like IPOPT or SNOPT at each step
05

Computational Profile and Real-Time Feasibility

MHE solves a nonlinear optimization problem at every time step, making it computationally heavier than recursive filters. Advances in solvers and warm-starting strategies have made it viable for real-time control.

  • Warm-starting: shifts the previous solution to initialize the next NLP
  • Real-time iteration: performs a single Newton step per sample for sub-millisecond execution
  • Typical solve times: 10–100 ms for moderate-sized problems on embedded hardware
  • Often paired with Model Predictive Control (MPC) using the same model and horizon
06

Disturbance and Fault Estimation

MHE can simultaneously estimate unmeasured disturbances and actuator faults by augmenting the state vector with additional parameters. This provides a unified framework for diagnosis and compensation.

  • Additive disturbance d_k models persistent plant-model mismatch
  • Multiplicative fault parameters detect actuator efficiency loss
  • Estimated disturbances can be fed forward to an MPC controller
  • Enables sensor fault detection by comparing measurements against predicted values within the horizon
MOVING HORIZON ESTIMATION

Frequently Asked Questions

Clear, technically precise answers to the most common questions about optimization-based state estimation for constrained dynamic systems.

Moving Horizon Estimation (MHE) is an optimization-based state estimation technique that determines the current state of a dynamic system by solving a constrained optimization problem over a finite, sliding window of the most recent N measurements. Unlike recursive filters that only consider the latest measurement, MHE reformulates the estimation problem at each time step using a batch of past data within the horizon. It minimizes a cost function that penalizes the mismatch between predicted and actual measurements and the deviation from a prior state estimate, known as the arrival cost. Crucially, MHE explicitly enforces physical constraints—such as non-negative concentrations, valve saturation limits, or temperature bounds—directly within the optimization, ensuring the estimated state is always physically plausible. The oldest measurement is discarded as a new one arrives, and the window slides forward, providing a computationally tractable way to incorporate delayed or multi-rate sensor data while maintaining constraint satisfaction.

STATE ESTIMATION COMPARISON

MHE vs. Kalman Filter vs. Particle Filter

A technical comparison of three recursive state estimation algorithms based on their mathematical foundations, constraint handling, and computational profiles.

FeatureMoving Horizon EstimationKalman FilterParticle Filter

Mathematical Foundation

Constrained optimization over a finite window

Recursive Bayesian estimation with Gaussian assumptions

Sequential Monte Carlo with importance sampling

System Model

Nonlinear or linear

Linear (EKF/UKF for nonlinear)

Nonlinear, non-Gaussian

Handles Hard Constraints

Handles Non-Gaussian Noise

Computational Cost

High (real-time NLP solve)

Low (matrix algebra)

Very High (many particles)

Uncertainty Representation

Arrival cost approximation

Covariance matrix

Weighted particle set

Typical Latency

10-100 ms

< 1 ms

100-1000 ms

Ideal Application

Chemical processes with safety limits

Navigation and tracking

Robotics with multi-modal distributions

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.