Interactive demo · Bayesian and Probabilistic Machine Learning · Chapter 13

Hidden Markov models: sampling, forward-backward, Viterbi and Baum-Welch

A hidden state zn ∈ {1, 2, 3} follows a Markov chain with transition matrix A, and each state emits a point xn in the plane from its own Gaussian (ellipses: 1 and 2 standard deviations). The forward-backward algorithm gives the posterior probability γ(zn) of each state at each step (a point's colour is the mix of the state colours); Viterbi finds the single most probable path; Baum-Welch is EM for the parameters, and its log likelihood can only go up.

Show

Sequence length N

Stay probability Akk

Emission spread (overlap)

Baum-Welch (EM)

Try these

True model: emission means (0.31, 0.72), (0.30, 0.20), (0.70, 0.47) and covariances read off Figure 13.8 of Bishop (2006), all standard deviations multiplied by the spread; off-diagonal transitions share 1 − Akk equally; π uniform. The left-to-right model starts in state 1, may only stay or move up by one, and stays with probability 1 − 3/N, so a sequence typically visits all three states. Baum-Welch starts from three data points chosen at random as means, the data covariance for every state and Akk = 0.6 (left-to-right: the sequence cut into thirds). The random numbers are seeded, so a class sees the same pictures.

In the lecture notes