Hidden Markov Models
An HMM models a sequence of observations generated by a hidden state that evolves as a Markov chain.
States you cannot see
A hidden Markov model (HMM) assumes an unobserved state sequence z_1..z_T that follows a Markov chain: the next state depends only on the current one through a transition matrix A. Each hidden state emits a visible observation through an emission distribution B. You observe the emissions and must infer the states or the parameters.
The three canonical problems
- Evaluation: compute the likelihood of an observation sequence, solved by the forward algorithm
- Decoding: find the most likely hidden path, solved by the Viterbi algorithm
- Learning: estimate A and B from data, solved by Baum-Welch, an EM instance
The core assumptions
Two independence assumptions make HMMs tractable: the current state depends only on the previous state (first-order Markov), and each observation depends only on the current state. These let the joint probability factor as a product of transitions and emissions, so dynamic programming over T steps and K states runs in O(T K^2) time.
Emissions can be discrete (a multinomial per state) or continuous (a Gaussian or Gaussian mixture per state). The state count is a modeling choice, often set by validation likelihood.
Where HMMs are used
HMMs power speech recognition front-ends, part-of-speech tagging, gene-finding in genomics, and gesture recognition. They are the generative counterpart to conditional random fields, which model the same sequences discriminatively. When state dynamics are continuous rather than discrete, the analogous tool is the Kalman filter.
The main limitation is the first-order assumption: real sequences often carry longer-range dependencies that a plain HMM cannot capture, motivating higher-order chains or neural sequence models.