Markov models represent a form of probabilistic modeling employed to forecast the future state of a system based on its present state. They enable future state prediction by considering both observed and unobserved states. Markov models can be categorized into observable and hidden models, depending on the available information for prediction and decision-making purposes.
Let’s illustrate the concept of Markov models. Suppose we have a bag with six balls of different colors: two red, three blue, and one green. We’ll randomly pick a ball, see its color, and return it to the bag. We notice a pattern after doing this a few times; the chance of picking a particular color ball stays the same. This happens because the likelihood of getting a specific color depends on how many balls of that color are in the bag.
In other words, the history of what’s been in the bag affects the future chances of picking a particular color. This example helps us understand Markov models, where the future depends on the present and the past. In this case, the present is the number of balls of each color in the bag, and the past is what was in the bag. Markov models help predict and understand how things change over time.
A hidden Markov model (HMM) is a category of Markov models incorporating hidden states. HMMs are used to model systems where certain states are not directly observable but can be inferred based on the observed states. This follows the Markov assumption, which states that the hidden state represents a variable that cannot be directly observed but depends only on the previous hidden state. By capturing the transitions between hidden states and the emission of observed states, HMMs enable us to analyze sequential data and make predictions or inferences about the underlying hidden states.
A Hidden Markov Model consists of several components that capture the underlying patterns in sequential data.
The start state represents the initial state of the model. It is the starting point from which the sequence of hidden and observed states begins. The start state is associated with a start probability, which indicates the likelihood of starting the sequence from a particular hidden state.
Hidden state represents the unobservable or latent state of a system. This characterizes the underlying dynamics or processes being modeled. Hidden states can be concepts, variables, or phenomena that are not directly accessible but influence the observed states.
Observed or emitted states are each hidden state’s measurable or observable outcomes. They represent the data or information that is available for analysis. The underlying hidden states influence the observed states and provide indirect insights into the hidden processes.
Start probabilities represent the initial probabilities of being in each hidden state at the start of the sequence. These probabilities reflect the likelihood of starting the sequence from a specific hidden state.
Transition probabilities describe the likelihood of transitioning from one hidden state to another. They capture the system’s dynamics and represent the probabilities of moving between hidden states at each time step. Transition probabilities in an HMM are typically modeled as conditional probabilities based on the previous hidden state.
Emission probabilities define the probability distribution of observing a particular state given the current hidden state. They represent the relationship between hidden states and observed states. Emission probabilities specify the likelihood of generating a specific observed state from a particular hidden state. These probabilities can be used to infer the underlying hidden states based on the observed data.
The illustration below depicts a simple example of an HMM containing the categories mentioned above:
Note: While a start state is typically included as part of the model’s structure, there are variations and extensions of HMMs that may not explicitly include a start state. For example, in some cases, a prior distribution or an initial state can be implicitly incorporated into the model without having a distinct start state. These variations allow for more flexibility in modeling different scenarios.
HMMs have a wide range of applications across various domains. Here are four real-life applications of HMMs, along with explanations of the hidden and observed states in each case.
HMMs can model the relationship between the hidden linguistic units (hidden states) and the observed acoustic features in speech recognition.
Hidden states: Phonemes or linguistic units representing the underlying speech sounds
Observed states: Acoustic features such as mel-frequency cepstral coefficients (MFCCs) or filterbank energies obtained from the audio signal
The model captures the probabilistic transitions between different phonemes or linguistic units based on the observed audio signal.
In parts of speech tagging, HMMs can be employed to predict the grammatical category of each word in a sentence.
Hidden states: Grammatical categories or parts of speech (e.g., noun, verb, adjective)
Observed states: Words or tokens in a sentence
The hidden states represent the underlying parts of speech, while the observed states are the words in the sentence. The HMM models the probabilistic transitions between different parts of speech based on observed words.
HMMs can be used to recognize gestures based on observed movements.
Hidden states: Gesture classes or types (e.g., swipe, tap, pinch)
Observed states: Time-series data of hand or body movements captured by sensors or cameras
The hidden states represent different gesture classes, while the observed states are the time-series data capturing the hand or body movements. The HMM model captures the probabilistic transitions between different gestures based on the observed movement patterns.
HMMs can be employed in stock market analysis to model different market regimes based on observed financial indicators.
Hidden states: Market regimes or states (e.g., bull market, bear market, volatile market)
Observed states: For historical financial indicators such as stock prices, trading volumes, or technical indicators
The hidden states represent the underlying market states, while the observed states are historical financial indicators. The HMM model captures the probabilistic transitions between market regimes based on observed indicators.
Free Resources