Nepedia
Back to Discover
Advanced Reader
🔢

Viterbi algorithm

math Maturity 7-9 Next article →

The Viterbi algorithm is a dynamic programming method used to find the most likely sequence of hidden events. These hidden events are the underlying causes that explain a series of observed events. In mathematics and computer science, this process is often applied to Hidden Markov Models (HMMs). An HMM is a system where you can see certain outcomes, but the actual states causing them remain invisible. The resulting sequence of most probable states is known as the Viterbi path. This algorithm is essential for making sense of noisy or incomplete data.

To understand the mechanism, imagine a system with a set of hidden states and a sequence of observations. The algorithm works by solving smaller subproblems at every time step. It builds two specific matrices to manage the data. The first matrix, often called the probability matrix, stores the maximum probability of ending up in a specific state at a specific time. It considers all possible sequences that could have led to that point. The second matrix, the backpointer matrix, tracks which previous state was used to reach that maximum probability.

An example of HMM
An example of HMM

The calculation follows a specific mathematical recurrence. For every state at a new time step, the algorithm looks at all possible previous states. It multiplies the previous maximum probability by the transition probability and the emission probability. The emission probability is the likelihood of seeing a specific observation given a certain state. The algorithm then selects the highest resulting value and stores it. Once the algorithm reaches the final observation, it identifies the state with the highest probability. It then follows the backpointers in reverse to reconstruct the entire Viterbi path.

The history of this discovery is a story of multiple independent inventions. Andrew Viterbi proposed the algorithm in 1967. He originally designed it as a decoding algorithm for convolutional codes. This was meant to help digital communication links handle noise. However, at least seven different researchers discovered similar methods independently. These include Needleman and Wunsch, as well as Wagner and Fischer. By 1987, the algorithm moved into the field of natural language processing. It became a standard way to perform part-of-speech tagging in linguistics.

The significance of the Viterbi algorithm is seen in its wide range of technical applications. It is a core component in digital cellular technologies like CDMA and GSM. It also enables reliable communication in dial-up modems, satellite systems, and deep-space missions. In wireless networking, it helps manage 802.11 LANs. Speech recognition technology relies on it to turn acoustic signals into strings of text. In bioinformatics, it helps scientists analyze biological sequences. The algorithm's efficiency is measured by its time complexity, which is related to the number of states and observations.

Consider a medical example to see the logic in action. A doctor observes a patient's symptoms, such as feeling normal, cold, or dizzy. The actual health condition, like being healthy or having a fever, is hidden. If a patient feels normal on day one, cold on day two, and dizzy on day three, the algorithm calculates the probabilities for every possible health sequence. Even if the patient felt cold on day two, the algorithm might determine they were still healthy. It might find the most likely sequence is (healthy, healthy, fever). It chooses the single path that provides the maximum likelihood for the entire observed history.

There are several advanced variations of this algorithm used for different needs. The max-sum or max-product algorithm is a generalization used in large graphical models like Bayesian networks. Another version is called iterative Viterbi decoding, which helps process turbo codes by reestimating scores until they converge. There is also the Lazy Viterbi algorithm, which is often faster than the original. It works by maintaining a prioritized list of nodes to evaluate rather than calculating every single node in the trellis. Finally, the Soft Output Viterbi Algorithm (SOVA) provides a measure of reliability. Instead of just giving a hard decision, it indicates how certain the algorithm is about its choice.

670 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (1)
File:An example of HMM.png
An example of HMM.png
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.