Hidden Markov Models (HMMs) are statistical models that describe the joint probability distribution of a sequence of observed events, X, and a sequence of hidden (or unobserved) states, Y. The joint probability distribution P(X, Y) in an HMM is modeled through two types of probabilities and an initial state distribution:
-
Transition probabilities: These are the probabilities of transitioning from one hidden state to another. If we have N hidden states, this can be represented as an N x N matrix ( A ), where each element ( a_{ij} ) represents the probability of moving from state i to state j.
-
Emission probabilities: These are the probabilities of an observed event given a hidden state. If there are M possible observed events, this can be represented as an N x M matrix ( B ), where each element ( b_{ij} ) represents the probability of observing the j-th event given the i-th hidden state.
-
Initial state probabilities: This is a distribution over the hidden states that defines the probability of starting in each state. It is represented as a vector ( \pi ), where each element ( \pi_i ) represents the probability that the first hidden state is i.
Given these components, the joint probability distribution P(X, Y) of an observed sequence ( X = (x_1, x_2, ..., x_T) ) and a corresponding sequence of hidden states ( Y = (y_1, y_2, ..., y_T) ) is calculated by taking the product of the initial state probability for the first state, the transition probabilities for each state transition, and the emission probabilities for each observation, as follows:
[
P(X, Y) = \pi_{y_1} \times b_{y_1 x_1} \times a_{y_1 y_2} \times b_{y_2 x_2} \times ... \times a_{y_{T-1} y_T} \times b_{y_T x_T}
]
This product includes the probability of starting in the initial hidden state ( y_1 ), the probability of each observation given the corresponding hidden state, and the probability of each transition between hidden states.
To compute the likelihood of just the observed sequence ( P(X) ) without caring about the particular sequence of hidden states, we can sum over all possible hidden state sequences:
[
P(X) = \sum_Y P(X, Y)