Variational Bayesian analysis of nonhomogeneous hidden Markov models with long and ultralong sequences

Xinyuan CHEN, Yiwei LI, Xiangnan FENG*, Joseph T. CHANG

*Corresponding author for this work

Research output: Journal PublicationsJournal Article (refereed)peer-review

1 Citation (Scopus)


Nonhomogeneous hidden Markov models (NHMMs) are useful in modeling sequential and autocorrelated data. Bayesian approaches, particularly Markov chain Monte Carlo (MCMC) methods, are principal statistical inference tools for NHMMs. However, MCMC sampling is computationally demanding, especially for long observation sequences. We develop a variational Bayes (VB) method for NHMMs, which utilizes a structured variational family of Gaussian distributions with factorized covariance matrices to approximate target posteriors, combining a forward-backward algorithm and stochastic gradient ascent in estimation. To improve efficiency and handle ultralong sequences, we further propose a subsequence VB (SVB) method that works on subsamples. The SVB method exploits the memory decay property of NHMMs and uses buffers to control for bias caused by breaking sequential dependence from subsampling. We highlight that the local nonhomogeneity of NHMMs substantially affects the required buffer lengths and propose the use of local Lyapunov exponents that characterize local memory decay rates of NHMMs and adaptively determine buffer lengths. Our methods are validated in simulation studies and in modeling ultralong sequences of customers’ telecom records to uncover the relationship between their mobile Internet usage behaviors and conventional telecommunication behaviors.
Original languageEnglish
Pages (from-to)1615-1640
Number of pages26
JournalAnnals of Applied Statistics
Issue number2
Publication statusPublished - 1 Jun 2023

Bibliographical note

We thank the Editor, the Associate Editor, and the reviewer for their constructive comments and suggestions. We thank Dr. Katarzyna Chawarska for valuable discussions. The content is solely the responsibility of the authors and does not necessarily represent the official views of the funding agencies.

Funding. Dr. Feng’s work was partially supported by the National Natural Science Foundation of China (72271060); Dr. Li’s work was partially supported by the Faculty Research Grant (DB20A3) at Lingnan University.


  • Nonhomogeneous hidden Markov model
  • variational Bayesian inference
  • local Lyapunov exponents
  • mobile Internet usage
  • local Lya-punov exponents


Dive into the research topics of 'Variational Bayesian analysis of nonhomogeneous hidden Markov models with long and ultralong sequences'. Together they form a unique fingerprint.

Cite this