FAQ
What background do I need?
Undergraduate probability, linear algebra through eigenvalues and eigenvectors, calculus, and some exposure to likelihood-based inference. Measure theory is not assumed — 1 Probability and linear algebra introduces the pieces that get used, and nothing beyond them is needed.
If Markov chains are unfamiliar, read 2 Markov chains carefully rather than skimming it. The contraction results there are used repeatedly.
Is there code?
No. The notes are language-agnostic and describe algorithms in enough detail to implement them in anything. 7 Computation and numerical practice covers the numerical issues that matter — scaling, log-domain arithmetic, complexity — and lists four invariants that catch most implementation bugs.
Zucchini et al. (2016) provide R code for everything in Parts II and III, and the telescope package (Malsiner-Walli et al. 2026) implements the mixture case of 11 The telescoping sampler.
Where should I start?
Depends on what you want. Appendix B — Reading guide sets out four routes with the dependencies. In short: for the algorithms, start at 4 Observation models; for the theory, start at 1 Probability and linear algebra; for Bayesian methods, read 5 Inference: filtering, smoothing, decoding then jump to 9 Bayesian inference.
Reading straight through also works — the chapters are ordered so that each depends only on those before it.
How do I choose the number of states?
The honest answer is that this is the hardest part of using an HMM, and the notes give it three separate treatments.
8 Asymptotic theory explains why the classical theory fails: a \(K\)-state model sits on the boundary of a \((K+1)\)-state one, the parameter is not identified there, and the likelihood ratio statistic has no \(\chi^2\) limit. AIC and BIC are used routinely but are heuristics in this setting.
11 The telescoping sampler puts a prior on \(K\) and samples it, giving a posterior distribution rather than a point choice. It also separates the number of states in the model from the number occupied by the data, which turns out to be the more stable and more interpretable quantity.
14 Applications makes the modelling argument: choose states you can interpret, and use the criteria to inform that choice rather than to make it. A three-state model whose states mean something usually beats a seven-state model with a better score.
Why does my EM fit give different answers each run?
Because it is finding local maxima, and which one it finds depends on where it starts. This is expected behaviour, not a bug — see 6 Maximum likelihood and EM and Proposition 3.3.
Run from many dispersed starting values and keep the best. If the emissions are Gaussian and unconstrained, also check that no state’s variance is collapsing towards zero; the likelihood is unbounded in that direction and the fit is chasing a singularity rather than a mode.
My Bayesian fit gives identical posteriors for every state. Why?
Label switching. The posterior is invariant under permuting the state labels, so if the sampler is mixing properly it visits all \(K!\) symmetric modes and every state-specific marginal is the same average. See Definition 9.3.
Counterintuitively, clean, distinct state-specific posteriors often indicate the sampler has failed to mix. Either report permutation-invariant quantities, or relabel the output deliberately using one of the methods in 9 Bayesian inference.
Should I use EM or MCMC?
EM is faster and gives a point estimate. MCMC gives uncertainty, handles the unbounded-likelihood problem through the prior, and extends naturally to unknown \(K\) and hierarchical structure.
Rydén (2008) compares them on identical problems and is worth reading before deciding. A reasonable default is to fit by EM from many starts to understand the likelihood surface, then run MCMC if uncertainty quantification matters.
What if my data are several short series rather than one long one?
Then the multilevel models of 10 Hierarchical models are the right formulation, not an optional refinement. Fitting each series separately wastes information and is unstable for short records; pooling them into one model ignores real heterogeneity. A hierarchical model interpolates between the two, and the data determine where.
Are there solutions to the exercises?
No. The exercises in 15 Exercises are intended for coursework, qualifying exam preparation and reading groups, and are graded (*) to (***).
The implementation exercises are more valuable than the proofs for most readers. Exercise 15.15 in particular tends to change how people think about maximum likelihood.
Can I use these for teaching?
Yes. 15 Exercises includes a twelve-week schedule mapping chapters to weeks, and Appendix B — Reading guide suggests adjustments for stronger or more applied cohorts.
How long does the course take?
Twelve weeks at two to three hours a week for the full set. An intensive reading course covering Parts I to IV compresses into eight weeks for well-prepared students. Parts V and VI work as a second-pass or as optional reading.