Preface
These are lecture notes on hidden Markov models, written at the level of a graduate course in statistics. They cover the model, the algorithms, the asymptotic theory, and the Bayesian and hierarchical extensions, with derivations given in full rather than cited.
The organising idea is that an HMM is a statement about conditional independence, and that almost every result follows from rewriting a conditional expectation. The forward algorithm, the Viterbi recursion, the EM updates, and the samplers of Part IV are all consequences of a single factorisation, and the notes try to make that visible rather than presenting them as separate inventions.
What is covered
I. Foundations
Conditional expectation and Markov kernels, spectral theory for stochastic matrices, convexity and KL divergence. Finite-state Markov chains: ergodicity, mixing, and the contraction results that reappear as filter stability.
II. The model
The two conditional independence assumptions, the factorisation they force, and the likelihood — as a sum over \(K^T\) sequences and as a product of \(T\) matrices. Then emission families, and identifiability from three consecutive observations.
III. Inference and estimation
Filtering, smoothing and decoding with correctness proofs. Maximum likelihood and EM as coordinate ascent on a lower bound. Numerical practice and complexity. Consistency and asymptotic normality.
IV. Bayesian and hierarchical inference
Priors, data augmentation, and forward filtering with backward sampling. Hierarchical state spaces, multilevel models across series, and hierarchical priors. The telescoping sampler for an unknown number of states.
V. Extensions
State-space models and the Kalman filter as a continuous-state forward algorithm. Switching models and why they are intractable. Regret bounds, and HMMs as partially observable decision problems.
VI. Applications and exercises
Speech, genomics, finance, animal movement and epidemiology, each analysed through the same four modelling questions. Proof-based exercises grouped by chapter, with a suggested twelve-week schedule.
How to read them
Each chapter opens with what you will be able to do by the end of it, and closes with a short self-check whose answers are hidden until you want them. The chapters are ordered so that each depends only on those before it, and reading straight through works.
Three shorter routes:
A first course on the algorithms. Chapters 3 The hidden Markov model to 7 Computation and numerical practice. Enough to specify, fit and check an HMM; skips the measure theory and the asymptotics.
Theory. Chapters 1 Probability and linear algebra, 2 Markov chains, 3 The hidden Markov model, 5 Inference: filtering, smoothing, decoding and 8 Asymptotic theory — a self-contained development from conditional expectation to asymptotic normality of the maximum likelihood estimator.
Bayesian methods. 9 Bayesian inference, 10 Hierarchical models and 11 The telescoping sampler, assuming 5 Inference: filtering, smoothing, decoding for the recursions. 11 The telescoping sampler is self-contained given 9 Bayesian inference and can be read on its own by anyone interested in the unknown-\(K\) problem.
Appendix B — Reading guide sets out the dependencies in more detail, and Appendix A — Notation collects the symbols.
Conventions
Notation follows Zucchini et al. (2016) wherever possible, so that formulas here match theirs term for term: \(\boldsymbol{\delta}\) for the initial distribution, \(\boldsymbol{\Gamma}\) for the transition matrix, \(f_i\) for the state-dependent densities. Where a result is stated without proof, a reference is given; where a proof is given, it is complete unless explicitly labelled a sketch.
Numbered definitions, theorems and examples are cross-referenced throughout and can be clicked. Citations are author–date and link to the bibliography.
Emphasis throughout is on which assumptions are doing the work. The conditions under which a theorem holds are usually more useful than the theorem, since applied work spends most of its time in situations where one of them fails.
Primary references
Four books cover most of what follows, and the notes are written to be read alongside them.
- Zucchini et al. (2016) — the standard applied treatment of finite-state HMMs, with R code and a wide range of worked examples. The source of the notation used here.
- Cappé et al. (2005) — the rigorous reference for inference and asymptotic theory, in general state spaces.
- Frühwirth-Schnatter (2006) — the reference for the Bayesian and mixture-model side, and the background for Part IV.
- Douc et al. (2014) — HMMs placed within the broader theory of nonlinear time series.
Full details are in the bibliography.
Cappé, Olivier, Éric Moulines, and Tobias Rydén. 2005.
Inference in Hidden Markov Models. Springer Series in Statistics. Springer.
https://doi.org/10.1007/0-387-28982-8.
Douc, Randal, Éric Moulines, and David S. Stoffer. 2014.
Nonlinear Time Series: Theory, Methods and Applications with R Examples. Chapman; Hall/CRC.
https://doi.org/10.1201/b16331.
Frühwirth-Schnatter, Sylvia. 2006.
Finite Mixture and Markov Switching Models. Springer Series in Statistics. Springer.
https://doi.org/10.1007/978-0-387-35768-3.
Zucchini, Walter, Iain L. MacDonald, and Roland Langrock. 2016.
Hidden Markov Models for Time Series: An Introduction Using R. 2nd ed. Chapman; Hall/CRC.
https://doi.org/10.1201/b20790.