The Hidden Markov model is a statistical model that describes the evolution of observable events that depend on internal factors that are not directly observable. The following graph shows the key elements of the model.
The graph has two parts, divided by a dashed line. Below the dashed line is the observed sequence; above the dashed line are the hidden states (so called because they are not directly observable). The hidden states have state transitions that introduce the state sequences.
In the following graph, the observed sequence is the weather, the hidden states are the seasons, and the state sequence is summer, fall, winter, spring. The states have outgoing edges to the observations, where the edge represents the emission. For example, summer emits good weather and winter emits bad weather.
The HMM model addresses three problems: Learning, Decoding, and Evaluating. The following graph assumes that historical weather data from years 2011 to 2013 is available to train the model. If the hidden states are labeled in the training data, this type of training process is called supervised learning. Otherwise, it is called unsupervised learning. To use unsupervised learning, you must specify the number of hidden states. After the model is trained, you can make predictions. Given the observed sequence, inferring the internal state is called decoding. Given the sequence, measuring the probability of the sequence is called evaluation.