Many robots and chemical plants estimate their hidden state by repeatedly fitting a physics model to a sliding window of recent sensor readings. This is moving horizon estimation (MHE): an optimization, re-solved every few milliseconds, that finds the state trajectory best explaining the last $M$ measurements while respecting physical constraints such as non-negative concentrations. Two practical tricks make this work in real time. The first is warm-starting: the solver begins from last step's answer shifted forward by one step and runs only a few iterations. The second is discounting: older measurements get geometrically smaller weight, so the estimate can follow a system whose behavior drifts. Both tricks are now backed by stability theory, but the two theories were developed separately. The warm-started, early-terminated case has been certified with fixed weights. The discounted case has been certified with a fixed discount, assuming every problem is solved exactly.
This note proposes that the two tricks should be designed together, and that the solver already produces the signal needed to do so. When the system changes regime (a gust, a catalyst deactivating, a circuit parameter jumping), the shifted warm-start lands far from the new optimum, and the first solver iterations move it a long way. That displacement comes free from the computation the estimator already performs. It says two things: the past is now misleading, so forget faster, and the current iteration budget is being outrun. We propose to set the discount online from this displacement, separately along each direction of the unknowns. We will prove that any such schedule remains stable as long as it stays within a certified range, and we will show empirically that the best discount depends on the iteration budget, not only on the data.
Core Claim
Under a fixed per-step iteration budget $k$, the discount factor $\eta$ plays three roles at once. It sets the statistical trade-off between noise and lag. It sets the decay rate of the stability certificate. It also changes how far the optimum moves between consecutive time steps, which is exactly the error a $k$-iteration warm-started solver must remove. Our claim has three parts. First, the accuracy-optimal discount $\eta^\star(k)$ shifts measurably with $k$, so a discount tuned for a fully converged solver is wrong for a 1–3 iteration real-time solver. Second, the warm-start displacement is a better signal for when and along which directions to forget than the usual measurement-residual (innovation) signal. The main reason is that in poorly excited directions the displacement stays small by construction, so the rule does not cause parameter windup there. Third, a schedule driven by this signal can be certified: the robust exponential stability of the estimator holds for any discount sequence inside an interval computed offline.
The discounted cost at time $t$, over a candidate trajectory $\chi$ with initial state $\chi_{t-M}$ and disturbance sequence $w$, is
$$J_t(\chi;\eta_t)=\eta_t^{M}\,\Gamma(\chi_{t-M})+\sum_{j=1}^{M}\eta_t^{\,j-1}\,\ell\big(w_{t-j},\,y_{t-j}-h(\chi_{t-j})\big).$$
Here $\Gamma$ is the prior ("arrival cost") on the window's first state, $\ell$ is a quadratic stage cost on disturbances and output residuals, $y$ are measurements, and $h$ is the output map. In the direction-wise version, the scalar $\eta_t$ becomes a diagonal matrix acting on the parameter block of the disturbance and prior terms.
Research Program
Certification layer. Two prior results supply this layer, and we do not claim them as the contribution.
A Lyapunov function for robust stability of moving horizon estimation builds an $M$-step Lyapunov function from the discounted MHE value function, assuming incremental input/output-to-state stability (δ-IOSS, a nonlinear notion of detectability) and exact minimization. Using linear matrix inequalities, it cuts certified horizons on a reactor from "at least 119, and in some cases, over 8 million steps" to $M=15$. Time-Discounted Incremental Input/Output-to-State Stability shows that discounted δ-IOSS is necessary for any robustly stable observer, so assuming it costs nothing.
Suboptimal Nonlinear Moving Horizon Estimation handles early termination. It evaluates a stable auxiliary observer's trajectory in the MHE cost and accepts any iterate whose cost does not exceed that trajectory's cost; the MHE then inherits the observer's stability for any horizon and any number of iterations.
We first extend this cost comparison to time-varying weights. We expect a direct argument: the comparison constants degrade by at most the ratio of the largest to smallest admissible weight. This lemma is what makes adaptive discounting safe, but we state openly that it is routine.
The interval $[\eta_{\min},\eta_{\max}]$ is then fixed offline. Its lower end is the value below which the discounted Lyapunov decrease fails. Its upper end is set by how much conditioning loss the solver can tolerate. At run time, the rule may choose any value in that interval.
The substantive theory. This part is a budget-dependent error bound. Near a locally strongly convex solution, a Gauss–Newton or projected-gradient solver contracts at some rate $q(\eta)<1$ per iteration. Its error after $k$ iterations is then roughly $q(\eta)^k\,\Delta_t(\eta)$, where $\Delta_t$ is the distance between the shifted warm-start and the new optimum. The form follows from standard linear convergence of these solvers. Heavier discounting (smaller $\eta$) shortens memory, which lowers bias after a shift. But it also makes consecutive optima jump more, which raises $\Delta_t$, and it weakens the curvature contributed by older data, which raises $q$.
Adding this solver term to the statistical terms of the discounted Lyapunov bound gives an explicit $\eta^\star(k)$. We will derive it in closed form for constrained linear MHE. In that setting, following Closed-loop Analysis of ADMM-based Suboptimal Linear Model Predictive Control, which models the plant and the internal states of an ADMM solver (an operator-splitting method) as one coupled system and proves stability with a small-gain argument, we treat the solver iterates as extra estimator state. That paper covers control with fixed weights and reports a conservative bound of $\ell^*=85$ iterations against 23–30 observed empirically. We carry the construction over to estimation with a time-varying discount. As a stretch goal, this would also remove the need for an auxiliary observer in the linear case.
The algorithm. At each step the estimator shifts the previous solution, runs iteration one, and measures the displacement projected onto each parameter direction. It normalizes this by a running noise-floor estimate and maps the result monotonically into the certified interval. Large normalized displacement means forget faster in that direction; small displacement means hold.
Because a Gauss–Newton step is small in directions where the data carry little curvature, the rule does not accelerate forgetting there. It therefore gives a continuous, component-wise version of the update/prediction mode switch in Nonlinear moving horizon estimation for robust state and parameter estimation. That paper freezes all parameters at once and names component-wise freezing as open. The auxiliary-observer cost check runs at every step as a safety net, and we log how often it rejects an iterate.
Benchmarks. We use the systems from the file, with regime shifts added because the published versions are mostly stationary.
The modified Chua circuit from Moving horizon estimation for nonlinear systems with time-varying parameters has a parameter that becomes unobservable during a quiet interval (steps 2000–3000). We add step changes to that parameter before and after the interval. The batch reactor ($A\rightleftharpoons B+C$, $2B\rightleftharpoons C$) from Suboptimal Nonlinear Moving Horizon Estimation gets a step change in a rate constant, mimicking catalyst loss.
For aerial robots we use two sources. The first is a simulated quadrotor with switching wind, following the 13-environment protocol of Contextual Neural Moving Horizon Estimation for Robust Quadrotor Control in Varying Conditions. The second is the real NeuroBEM flight logs: 96 flights, speeds up to 18 m/s. There we estimate the external aerodynamic force, which changes regime with speed and maneuver.
Baselines
The naive reference is fixed-discount warm-started suboptimal MHE: the Müller–Schiller scheme with one discount $\eta$ chosen for the fully converged problem, run at the same budget $k\in\{1,2,3,5\}$. This is what a practitioner would deploy today. Beating it by a clear margin on post-shift recovery time and window RMSE is the minimum bar.
The strongest fixed competitor is the same scheme with $\eta$ grid-searched separately for each budget $k$ and each benchmark, on held-out shift sequences, with the same tuning budget our method gets for its two mapping constants. If our adaptive rule does not beat this on non-stationary sequences, the adaptivity adds nothing and only the budget-aware tuning finding survives.
The strongest existing method for time-varying parameters is the adaptive-regularization MHE of Nonlinear moving horizon estimation for robust state and parameter estimation, with its excitation monitor. It reports parameter RMSE 0.0209 against 0.1379 for naive MHE on the Chua quiet-interval benchmark, under full convergence. We run it both fully converged, where 0.0209 on the original protocol is our reproduction check, and truncated to $k$ iterations. Beating it means lower parameter RMSE than its truncated version at equal $k$, and staying within about 1.5× of its converged value at $k\le 3$.
We also run an innovation-driven adaptive forgetting baseline, which sets $\eta_t$ from normalized output residuals as in classical adaptive-forgetting least squares. We run two classical estimators: an extended Kalman filter (EKF) with a fading-memory factor, and the standalone auxiliary observer. The key ablation keeps everything else fixed and swaps only the forgetting signal (solver displacement versus innovation), and scalar versus direction-wise discounting. All methods share the same model, horizon, solver, iteration cap, and wall-clock measurement on one CPU.
Why not just…?
Why not just tune a fixed discount offline for the iteration budget? This is the most serious threat. If the non-stationarity is mild or its rate is constant, a budget-specific fixed $\eta$ may capture most of the gain. Our own first claim, that $\eta^\star$ depends on $k$, would then be the whole contribution. The per-$k$ grid-searched baseline settles this directly. We will report where the adaptive rule wins (sequences with alternating shocks and quiet periods) and where it does not, since a fixed value cannot be both aggressive after a shock and conservative during a quiet interval.
Why not just drive forgetting from measurement residuals, as adaptive-forgetting least squares does? Residuals do detect change. But they are one number in measurement space and say nothing about which unknowns are responsible. Applied uniformly, they raise forgetting in unexcited directions too, which causes the windup that the Chua experiment in Nonlinear moving horizon estimation for robust state and parameter estimation exposes, with naive MHE drifting to 0.1379 RMSE. The signal-swap ablation during the quiet interval tests exactly this. If the innovation rule matches ours there, the solver-displacement signal is not justified.
Why not just run more iterations, or solve to convergence, on faster hardware? Warm-start studies in the file report cold or unconverged solving costing roughly three times the iterations (Distributed Formation Control for Multi-Vehicle Systems With Splitting and Merging Capability) or nearly ten times the time (Autonomous docking using direct optimal control). Budgets on quadrotors are fixed by the control rate. We will nonetheless report accuracy against wall-clock time. If our $k=2$ estimator is not better than the fixed-discount estimator at the $k$ that takes equal time, we will say so.
Why not just use an EKF with fading memory? It cannot enforce constraints. A Lyapunov function for robust stability of moving horizon estimation reports the EKF failing on a constrained quadrotor, and the contextual quadrotor MHE reports a 24.2% lower maximum position error than an EKF. We include it only as a reference point.
Proposed Experiments
The first decisive check is the budget-dependence curve. For each benchmark and each $k$, we sweep $\eta$ and plot window RMSE with fixed-weight warm-started MHE, then check whether the minimizer moves with $k$ as the bound predicts. We also compare the linear-case closed form against the empirical minimizer. If $\eta^\star$ does not move, the core premise fails and we stop there.
The second is post-shift recovery. For each injected step change, we measure how many steps it takes for estimation error to fall back below a fixed threshold, and the peak error in between, across all methods at $k\in\{1,2,3\}$. On the quadrotor we also report maximum absolute position error when the estimate feeds a tracking controller; the contextual MHE's reported 20.3% gain over a global model sets the scale of improvement worth claiming.
The third is the windup test on the Chua quiet interval, with the signal and component ablations. We also report the fraction of steps where the auxiliary-observer cost check rejected the solver's iterate, as an empirical measure of how often the certified safety net is actually needed. For the linear constrained case, we compare the derived iteration bound against the smallest empirically stable $k$, measuring the conservatism that Closed-loop Analysis of ADMM-based Suboptimal Linear Model Predictive Control found at 85 versus 23–30 iterations.
On the real NeuroBEM logs no reported result was found on Lacuna for truncated-iteration MHE force estimation, so we will establish the fixed-discount baseline ourselves before comparing.
References
- A Lyapunov function for robust stability of moving horizon estimation
- Time-Discounted Incremental Input/Output-to-State Stability
- Suboptimal nonlinear moving horizon estimation
- Closed-Loop Analysis of ADMM-Based Suboptimal Linear Model Predictive Control
- Nonlinear moving horizon estimation for robust state and parameter estimation
- Moving horizon estimation for nonlinear systems with time-varying parameters
- Contextual Neural Moving Horizon Estimation for Robust Quadrotor Control in Varying Conditions
- NeuroBEM: Hybrid Aerodynamic Quadrotor Model
- Distributed Formation Control for Multi-Vehicle Systems With Splitting and Merging Capability
- Autonomous docking using direct optimal control