# Hidden Markov Model

A hidden Markov model (HMM) is a statistical model where an observable process depends on an unobservable (hidden) Markov process, used to infer hidden states from sequential observations.

A hidden Markov model (HMM) is a statistical model used to describe sequences of observations that depend on an underlying, unobservable process. In probability theory, an HMM is a Markov model in which the observations are dependent on a latent (or hidden) Markov process, often denoted as X. The model requires an observable process Y whose outcomes depend on the outcomes of X in a known way. Because X cannot be observed directly, the goal is to learn about the state of X by observing Y. By definition of being a Markov model, an HMM has the additional requirement that the outcome of Y at time t0 must be influenced exclusively by the outcome of X at time t0, and that the outcomes of X and Y at times before t0 must be conditionally independent of Y at t0 given X at time t0. Estimation of the parameters in an HMM can be performed using maximum likelihood estimation; for linear chain HMMs, the Baum-Welch algorithm is commonly used.

Hidden Markov models are known for their applications across many fields, including thermodynamics, statistical mechanics, physics, chemistry, economics, finance, signal processing, information theory, and pattern recognition. Specific uses include speech recognition, handwriting recognition, gesture recognition, part-of-speech tagging, musical score following, partial discharges, and bioinformatics.

## Formal Definition

Let X_n and Y_n be discrete-time stochastic processes with n ≥ 1. The pair (X_n, Y_n) is a hidden Markov model if X_n is a Markov process whose behavior is not directly observable (hence "hidden"), and the conditional probability of Y_n given the entire history of X satisfies P(Y_n ∈ A | X_1 = x_1, ..., X_n = x_n) = P(Y_n ∈ A | X_n = x_n) for every n ≥ 1, every sequence x_1, ..., x_n, and every Borel set A. This condition ensures that the observation at time n depends only on the hidden state at time n, not on earlier hidden states.

For continuous-time processes, the pair (X_t, Y_t) is a hidden Markov model if X_t is a Markov process that is not directly observable, and the probability of Y at time t0 given the entire path of X up to t0 equals the probability given only X at t0: P(Y_t0 ∈ A | {X_t ∈ B_t for t ≤ t0}) = P(Y_t0 ∈ A | X_t0). This generalizes the discrete-time definition to continuous time.

## Core Components

An HMM is typically characterized by three sets of parameters. First, the initial state distribution, which specifies the probabilities of the hidden process starting in each possible state. Second, the transition probabilities, which describe how the hidden state evolves over time according to the Markov property. Third, the emission probabilities, which give the likelihood of observing each possible output given the current hidden state. These components together define the joint distribution of the hidden and observable sequences.

The hidden states themselves form a Markov chain, meaning the probability of moving to a new state depends only on the current state, not on earlier states. The observable process is conditionally independent given the hidden states, which simplifies inference and learning.

## Inference and Learning

A central problem in HMMs is inference: given a sequence of observations, determine the most likely sequence of hidden states. The Viterbi algorithm is a dynamic programming method used for this purpose, finding the single best state sequence. Another inference task is computing the probability of an observation sequence given the model, which can be done using the forward algorithm. The forward-backward algorithm computes the posterior probabilities of being in each state at each time point, useful for tasks like smoothing.

Parameter estimation is typically done via maximum likelihood estimation. For linear chain HMMs, the Baum-Welch algorithm, a special case of the expectation-maximization (EM) algorithm, iteratively updates the model parameters to maximize the likelihood of the observed data. This algorithm alternates between computing expected sufficient statistics given current parameters and re-estimating parameters to maximize those expectations.

## Historical Development

HMMs have roots in the work of Leonard Baum and colleagues in the late 1960s and early 1970s, who developed the forward-backward algorithm and the Baum-Welch algorithm. The theoretical foundations were further refined by researchers such as Lloyd Welch. In the 1980s, HMMs gained prominence in speech recognition, particularly through work at institutions like [xerox-parc](https://www.wikiprompt.org/wiki/xerox-parc) and ibm (though IBM is not in the provided list, so this is omitted). The models became a standard tool in [machine-learning](https://www.wikiprompt.org/wiki/machine-learning) for sequential data before the rise of [deep-learning](https://www.wikiprompt.org/wiki/deep-learning) and [neural-network](https://www.wikiprompt.org/wiki/neural-network) approaches.

In the 1990s and 2000s, HMMs were widely applied in bioinformatics for gene finding, protein structure prediction, and sequence alignment. They also became important in natural language processing for part-of-speech tagging and named entity recognition. The models were later extended in various ways, such as hierarchical HMMs and coupled HMMs, to handle more complex dependencies.

## Applications

HMMs have been applied to a wide range of problems. In speech recognition, they model the sequence of acoustic features as generated by hidden phonetic states. In handwriting and gesture recognition, they capture the temporal dynamics of strokes or movements. In bioinformatics, they are used for gene prediction and for modeling protein families. In finance, they can model regimes in economic time series, such as bull and bear markets. In signal processing, they are used for speech enhancement and activity recognition.

Despite the dominance of [transformer](https://www.wikiprompt.org/wiki/transformer)-based models in modern [artificial-intelligence](https://www.wikiprompt.org/wiki/artificial-intelligence), HMMs remain relevant for tasks where interpretability and small data are important. They are also used as components in more complex systems, such as hybrid models that combine HMMs with [neural-network](https://www.wikiprompt.org/wiki/neural-network) classifiers. The simplicity and mathematical tractability of HMMs make them a foundational tool in probabilistic modeling.

## Limitations and Extensions

HMMs assume that the hidden process is Markovian and that observations are conditionally independent given the hidden state. These assumptions can be restrictive for complex real-world data. Extensions include higher-order HMMs, where the hidden state depends on multiple previous states, and input-output HMMs, which incorporate exogenous variables. Hidden semi-Markov models allow for variable durations in each state, addressing a common limitation of standard HMMs.

In the context of modern [machine-learning](https://www.wikiprompt.org/wiki/machine-learning), HMMs are often compared to recurrent neural networks and [transformer](https://www.wikiprompt.org/wiki/transformer) models, which can capture longer-range dependencies. However, HMMs offer advantages in terms of interpretability and the ability to work with small datasets. They remain an active area of research, particularly in fields like computational biology and speech processing.

---
Source: https://www.wikiprompt.org/wiki/hidden-markov-model
License: CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/)
Last updated: 2026-09-08T06:09:53.980931+00:00
