We derive a robust update rule for the online infinite hidden Markov model (iHMM) for when the streaming data contains outliers and the model is misspecified. Leveraging recent advances in generalised Bayesian inference, we define robustness via the posterior influence function (PIF), and provide conditions under which the online iHMM has bounded PIF. Imposing robustness inevitably induces an adaptation lag for regime switching. Our method, which is called Batched Robust iHMM (BR-iHMM), balances adaptivity and robustness with two additional tunable parameters. Across limit order book data, hourly electricity demand, and a synthetic high-dimensional linear system, BR-iHMM reduces one-step-ahead forecasting error by up to 67% relative to competing online Bayesian methods. Together with theoretical guarantees of bounded PIF, our results highlight the practicality of our approach for both forecasting and interpretable online learning.
Figures & tables
Figure 1: Data ( blue dotted line ) generated according to ( 139 ) with Student- t observation noise. The outliers are marked with x . The solid red line shows our BR-iHMM , and the solid orange line shows the standard online iHMM. Regions around the posterior predictive mean cover ±2 standard deviations as error bounds.
Figure 2: Bayesian architecture of the BR-iHMM . Variables in a circle are updated during inference. Red variables are fixed hyperparameters. For instance, the priors of γ and α are both uninformed Γ(1,1) for all our experiments.
Model
Synthetic
Electricity
OFI
BR-iHMM
46.1 ± 0.00301
0.47 ± 0.04
0.616 ± 0.082
WoLF-iHMM
103.8 ±0.01155
0.63 ± 0.03
0.623 ± 0.089
iHMM
101.7 ±0.02636
0.57 ± 0.03
0.620 ± 0.080
offline-iHMM
2.9
0.32
0.552
BOCD
123.12±0.01365
0.80±0.11
0.733
Table 1: One-step ahead RMSE (Mean ± stdev) over 100 runs. The most precise online model is bolded.
Figure 3: Synthetic linear data. Outliers are marked by red vertical dashes. Yellow and blue regions correspond to regimes 2 and 3. First subplot tracks rolling RMSE of mean predictions across the 100 runs. Bottom plot shows average MAP state. First 900 predictions are plotted. The full Figure E.11 is in the appendix.
Figure 4: Cumulative RMSE for OFI predictions. offline-iHMM is not plotted to allow zooming into the difference between the online models. Vertical dotted red lines indicate an outlier (defined as outside 1.5 × inter-quartile range).
Model
PPV
TPR
Delay
BR-iHMM
0.963±0.001
0.996±0.001
3.4±0.0
WoLF-iHMM
0.533±0.002
0.344±0.002
0.0±0.0
iHMM
0.551±0.002
0.363±0.008
0.2±0.0
offline-iHMM
0.996
0.997
0.0
Table 2: Values are averaged over 100 runs for online models. Higher PPV and TPR is better, lower DD is better.
Appendix figures & tables23 assets
Supplementary material from the paper’s appendix.
Appendix
Symbol
Description
∥⋅∥2
ℓ2 norm.
∥⋅∥Rt
Mahalanobis norm with respect to Rt .
N(y∣μ,Σ)
Multivariate Gaussian density evaluated at y with mean μ and covariance Σ .
DP(γ,H)
Dirichlet process with base measure H and γ>0
Dir(π∣β)
Dirichlet density evaluated at π with base prior β .
Algorithm 7 Batched Online iHMM with WoLF ( BR-iHMM )
Parameter
Model
τESS
all
BayesOpt
c2
WoLF-iHMM , BR-iHMM
BayesOpt
B
BR-iHMM
BayesOpt
Appendix
Table C.4 : Summary of hyperparameters across iHMMs.
Model
Synthetic
Electricity
OFI
BR-iHMM
46.1 ± 0.00301
0.47 ± 0.04
0.616 ± 0.082
WoLF-iHMM
103.8 ±0.01155
0.63 ± 0.03
0.623 ± 0.089
iHMM
101.7 ±0.02636
0.57 ± 0.03
0.620 ± 0.080
offline-iHMM
2.9
0.32
0.552
BOCD
123.12±0.01365
0.80±0.11
0.733
Appendix
Table E.5 : Forecast performance in terms of one-step ahead RMSE (Mean ± stdev) over 100 runs. The most precise online model is bolded. The BOCD implementation for the OFI experiment is from Tsaknaki et al. (2025) and has no randomisation. offline-iHMM is only ran once.
Dataset
BR-iHMM
WoLF-iHMM
iHMM
Synthetic
64.0 ± 0.27
66.1 ± 0.35
66.3 ± 0.20
Electricity
274.2 ± 0.5
351.1 ± 1.7
351.9 ± 1.4
LOB
95.2 ± 0.6
94.3 ± 1.8
96.1 ± 1.0
Appendix
Table E.6 : Average runtime in seconds across 100 runs across experiments (Mean ± stdev). Fastest model is highlighted.
Figure E.5 : State-space PIF. T he non-batched PIF grows unbounded and is irrespective of the IMQ weights. The batched PIFs remains bounded even under large offsets in contrast. c2 is the IMQ scale.
Figure E.6 : The left hand plot shows a lack of preference if state variance is high. In the right hand plot, the batch size is B=6 and an outlier y1c is in the batch.
Figure E.7 : Difference in log-likelihood for the unknown mean unknown variance case.
Figure E.8 : BR-iHMM (with known variance) vs classical iHMM (unknown-var) . The unknown variance iHMM has a Student-t posterior predictive and is still sensitive to outliers. Student-t remains non-robust and changes states, yet the BR-iHMM model is robust.
Dataset
Hyperparameter
BR-iHMM
WoLF-iHMM
iHMM
Well-log
τESS
10
10
54
c2
2.124
1.657
–
B
21
–
–
Synthetic
τESS
2
1
0
c2
1.348
3.589
–
B
2
–
–
Appendix
Table E.7 : Summary of fitted hyperparameters obtained from Bayesian optimisation. Same hyperparameters are used in subsequent runs throughout the same dataset. Extra hyperparameters are included where appropriate. Σ0 is the initial variance for newly initiated states, for an m -dimensional state vector, the initial covariance matrix is then set to Σ0Im where Im is the m -dimensional identity matrix. For the Well-log and Synthetic experiment, Σ0 is set to 1 . ρ∗ is the autoregressive coefficient in the OFI DGP ( 141 ). p denotes the degree of feature engineering of the weather covariates, see Section E.11 . MAX_STATES = 30 for all three online iHMM models.
Figure E.9 : Comparison of iHMM filtered mean and maximum a-posteriori (MAP) state inference with different degrees of robustness on the well-log data. Top subplot overlays the well-log data with the filtered values of iHMM , iHMM (unknown-var) , WoLF-iHMM , BR-iHMM , DSM-BOCD , and offline-iHMM . Bottom subplot shows the MAP state inference.
Model
PPV
TPR
Delay
BR-iHMM
0.4739±0.0636
0.5797±0.0885
78.06±46.95
WoLF-iHMM
0.3384±0.588
0.3384±0.0588
63.20±16.50
iHMM
0.4086±0.0635
0.4970±0.0924
19.19±11.38
Appendix
Table E.8 : Regime classification performances on synthetic data. PPV, TPR, and delays are averaged over 100 runs for online models. Higher PPV and TPR is better, lower detection delay is better.
Figure E.10 : Lookahead MAE and detection delay for different batch sizes. The blue graph, corresponding to the axis on the left, plots the detection delay of BR-iHMM as we increase the batch size. The orange graph, corresponding to the axis on the right, plots the lookahead MAE for different batch sizes.
Figure E.11 : Synthetic linear data. Outlier observations are marked by red vertical dashes. Yellow and blue regions correspond to regimes 2 and 3. First subplot tracks rolling RMSE of mean predictions across the 100 runs. Second subplot compares the L2 distance between average latent state (per model) versus the true data generating state μt . The bottom plot shows average MAP state. Each plot overlays the results for all four models. All data points are plotted.
Figure E.12 : RMSE and detection delay for different batch sizes. The blue graph, corresponding to the axis on the left, plots the detection delay of BR-iHMM as we increase the batch size. The orange graph, corresponding to the axis on the right, plots the RMSE for different batch sizes.
Model
PPV
TPR
Delay
BR-iHMM
0.963±0.001
0.996±0.001
3.4±0.0
WoLF-iHMM
0.533±0.002
0.344±0.002
0.0±0.0
iHMM
0.551±0.002
0.363±0.008
0.2±0.0
offline-iHMM
0.996
0.997
0.0
Appendix
Table E.9 : Values are averaged over 100 runs for online models. Higher PPV and TPR is better, lower DD is better.
Figure E.13 : IID synthetic data with Gaussian noise. Outliers are marked with a red cross . Top panel compares predicted value, lower panel compares MAP states.
Figure E.14 : IID synthetic data with t-noise. Outliers are marked with a red cross . Top panel compares predicted value, lower panel compares MAP states.
Figure E.15 : Hourly electricity demand. Top panel plots the rolling RMSE with a window of 100 for each model. Bottom panel plots MAP state. Each plot overlays the results for all three models. The MAP state of iHMM did not change, WoLF-iHMM detected a small change towards the end.
Figure E.16 : Electricity data. Standardised data for all 31912 data points standardised per dimension. Electricity demand is measured in Load (kW) . Data shows clear periodicity.
Figure E.17 : Electricity demand forecasts produced by iHMM , WoLF-iHMM , and BR-iHMM respectively. MAP states are plotted on the right hand axis for each model in purple . The true standardised electricity demands are plotted in blue in the background.
Figure F.18 : Top panel plots the observations. Middle panel plots the actual variance, along with variance estimates between a naive one-state GARCH and an iHMM of GARCH models. Bottom panel plots inferred regime probabilities for the iHMM GARCH model.
We develop a predictive-first optimisation framework for streaming hidden Markov models. Unlike classical approaches that prioritise full posterior recovery under a fully specified generative model, we assume access to regime-specific predictive models whose parameters are learned online while maintaining a fixed transition prior over regimes. Our objective is to sequentially identify latent regimes while maintaining accurate step-ahead predictive distributions. Because the number of possible regime paths grows exponentially, exact filtering is infeasible. We therefore formulate streaming inference as a constrained projection problem in predictive-distribution space: under a fixed hypothesis budget, we approximate the full posterior predictive by the forward-KL optimal mixture supported on S paths. The solution is the renormalised top-S posterior-weighted mixture, providing a principled derivation of beam search for HMMs. The resulting algorithm is fully recursive and deterministic, performing beam-style truncation with closed-form predictive updates and requiring neither EM nor sampling. Empirical comparisons against Online EM and Sequential Monte Carlo under matched computational budgets demonstrate competitive prequential performance.
In this work, we propose an adaptive robust loss function framework for MHE, integrating an adaptive robust loss function to reduce the impact of outliers with a regularization term that avoids naive solutions. The proposed approach prioritizes the fitting of uncontaminated data and downweights the contaminated ones. A tuning parameter is incorporated into the framework to control the shape of the loss function for adjusting the estimator's robustness to outliers. The simulation results demonstrate that adaptation occurs in just a few iterations, whereas the traditional behaviour L2 predominates when the measurements are free of outliers.
Nestor Deniz, Guido Sanchez, Fernando Auat Cheein +1
Instituto de Investigación en Senales, Sistemas e Inteligencia Computacional, sınc(i), UNL-CONICET, Santa Fe, Argentina · Harper Adams University, Engineer Department, Edgmond, Newport TF10 8NB
Bayesian online learning promises uncertainty-aware prediction on data streams, but its performance hinges on inferential choices, including learning rates, prior distributions and variational families, which are usually fixed before seeing the stream. We address this by treating Bayesian update rules as experts and aggregating the Bayesian experts according to sequential predictive losses. We prove that the resulting aggregate competes with the best expert in hindsight at an aggregation cost determined by how each expert's per-round performance is evaluated. We instantiate the framework in online conformal inference and Gaussian process regression. The conformal inference application yields a smoothed Bayesian counterpart of adaptive conformal inference with long-run randomized coverage, while the Gaussian process application gives an oracle inequality in cumulative predictive Kullback-Leibler risk and adaptation to unknown Hölder smoothness up to logarithmic factors. Experiments show that the aggregate tracks strong experts without oracle expert selection.
Jungbin Jun, Ilsang Ohn
Department of Statistics Inha University Incheon, 22212, South Korea