Markov-Switching Vector Autoregression for Latent Glycaemic Regimes in Real-World Diabetes Self-Monitoring Data: An Out-of-Sample Evaluation
DOI:
https://doi.org/10.71310/pcam.5_76.2026.05Keywords:
diabetes self-monitoring data, Markov-switching vector autoregression, hidden Markov model, latent regime, out-of-sample evaluation, held-out log-likelihood, model selectionAbstract
Self-monitoring records of blood glucose and insulin dose form irregular time series whose physiological regime is not observed. This study fits a Markov-switching vector autoregression, MS-VAR(1), with regime-specific intercepts, autoregressive matrices and covariances to raw event logs of the public UCI AIM’94 data and asks what regime switching adds to out-of-sample prediction. Each patient is modelled separately by expectation–maximisation with exact forward–backward smoothing, without any regime label; 20 of 70 patients (2189 glucose-recording days) met a priori recording criteria. Models were compared by one-step-ahead predictive log-likelihood per day on the final 20% of each series against a single-regime VAR(1), a Gaussian hidden Markov model (HMM), a single-pass switching model and a static Gaussian, using paired Wilcoxon tests with Holm correction and BIC. A feature set containing both levels and first differences is degenerate for a firstorder autoregression: two features are exact linear functions of the lagged state, and the smallest residual-covariance eigenvalue equalled the regularisation floor in all 20 patients. In that specification the advantage over the HMM was reproduced, but a single-regime VAR(1) did equally well. After removing the redundant features, MS-VAR(3) was not better than the single-regime VAR(1) (median paired difference −0.31 nats/day, 95% CI [−1.11, 0.89]), BIC selected at most two regimes in 17 of 20 patients, and the advantage over the HMM (+2.33 nats/day) did not survive Holm correction (???? = 0.069). The fitted regimes were persistent (mean dwell time 10.2 days) and ordered in mean glucose (137, 160, 194 mg/dL), but day-level labels were noise-sensitive (ARI 0.78 at noise SD 0.05). Regime switching is thus supported as a descriptive segmentation, not as a predictive improvement.
References
Rabiner L. R. 1989. A tutorial on hidden Markov models and selected applications in speech recognition. Proceedings of the IEEE. 77(2): 257–286. doi: https://doi.org/10.1109/5.18626.
Hamilton J. D. 1989. A new approach to the economic analysis of nonstationary time series and the business cycle. Econometrica. 57(2): 357–384.
Krolzig H.-M. 1997. Markov-Switching Vector Autoregressions: Modelling, Statistical Inference, and Application to Business Cycle Analysis. Berlin: Springer. 357 p.
Ghahramani Z., Hinton G. E. 2000. Variational learning for switching state-space models. Neural Computation. 12(4): 831–864. doi: https://doi.org/10.1162/089976600300015619.
Cobelli C., Dalla Man C., Sparacino G., Magni L., De Nicolao G., Kovatchev B. 2009. Diabetes: models, signals, and control. IEEE Reviews in Biomedical Engineering. 2: 54–96. doi: https://doi.org/10.1109/RBME.2009.2036073.
Bergman R. N., Ider Y. Z., Bowden C. R., Cobelli C. 1979. Quantitative estimation of insulin sensitivity. American Journal of Physiology. 236(6): E667–E677. doi: https://doi.org/10.1152/ajpendo.1979.236.6.E667.
Weir G. C., Bonner-Weir S. 2004. Five stages of evolving beta-cell dysfunction during progression to diabetes. Diabetes. 53(Suppl. 3): S16–S21. doi: https://doi.org/10.2337/diabetes.53.suppl_3.s16.
Kalman R. E. 1960. A new approach to linear filtering and prediction problems. Journal of Basic Engineering. 82(1): 35–45. doi: https://doi.org/10.1115/1.3662552.
Wang Q., Molenaar P., Harsh S. [et al.] 2014. Personalized state-space modeling of glucose dynamics for type 1 diabetes using continuously monitored glucose, insulin dose, and meal intake: an extended Kalman filter approach. Journal of Diabetes Science and Technology. 8(2): 331–345. doi: https://doi.org/10.1177/1932296814524080.
Clausen H. G., Leth J., Knudsen T., Schiøler H. 2020. State estimation in type 2 diabetes using the continuous-discrete unscented Kalman filter. IFAC-PapersOnLine. 53(2): 16500–16505. doi: https://doi.org/10.1016/j.ifacol.2020.12.754.
Dempster A.P., Laird N. M., Rubin D.B. 1977. Maximum likelihood from incomplete data via the EM algorithm. Journal of the Royal Statistical Society, Series B. 39(1): 1–38.
Billio M., Monfort A. 1998. Switching state-space models: likelihood function, filtering and smoothing. Journal of Statistical Planning and Inference. 68(1): 65–103. doi: https://doi.org/10.1016/S0378-3758(97)00136-5.
Kahn M. 1994. Diabetes [data set]. UCI Machine Learning Repository. URL: https://archive.ics.uci.edu/dataset/34/diabetes.
Pedregosa F., Varoquaux G., Gramfort A. [et al.] 2011. Scikit-learn: machine learning in Python. Journal of Machine Learning Research. 12: 2825–2830.
Hubert L., Arabie P. 1985. Comparing partitions. Journal of Classification. 2: 193–218.
Holm S. 1979. A simple sequentially rejective multiple test procedure. Scandinavian Journal of Statistics. 6(2): 65–70.
Schwarz G. 1978. Estimating the dimension of a model. Annals of Statistics. 6(2): 461–464.
Rousseeuw P. J. 1987. Silhouettes: a graphical aid to the interpretation and validation of cluster analysis. Journal of Computational and Applied Mathematics. 20: 53–65.
Caliński T., Harabasz J. 1974. A dendrite method for cluster analysis. Communications in Statistics. 3(1): 1–27.
Davies D. L., Bouldin D. W. 1979. A cluster separation measure. IEEE Transactions on Pattern Analysis and Machine Intelligence. PAMI-1(2): 224–227.
Downloads
Published
Issue
Section
License
Copyright (c) 2026 A.A. Akbarova

This work is licensed under a Creative Commons Attribution 4.0 International License.