# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.stats.hmm

## Class Viterbi

• public class Viterbi
extends Object
The Viterbi algorithm is a dynamic programming algorithm for finding the most likely sequence of hidden states - called the Viterbi path - that results in a sequence of observed events, especially in the context of Markov information sources and hidden Markov models.
• Rabiner, L.R. "A tutorial on hidden Markov models and selected applications in speech recognition," Proceedings of the IEEE. Volume 77, Issue 2, 257 - 286. Feb 1989.
• W. Zucchini and I. L. MacDonald, "Hidden Markov Models for Time Series: An Introduction Using R," Boca Raton, Florida, CRC Press, 2009.
• Wikipedia: Viterbi algorithm
• "ref/hmm/viterbi.pdf"
• ### Constructor Summary

Constructors
Constructor and Description
Viterbi(HiddenMarkovModel model)
Constructs an Viterbi algorithm for an HMM.
• ### Method Summary

All Methods
Modifier and Type Method and Description
int[] getViterbiStates(double[] observations)
Gets the most likely sequence of states using Viterbi algorithm (global decoding), given the observations and the underlying hidden Markov model.
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Constructor Detail

• #### Viterbi

public Viterbi(HiddenMarkovModel model)
Constructs an Viterbi algorithm for an HMM.
Parameters:
model - the underlying hidden Markov model
• ### Method Detail

• #### getViterbiStates

public int[] getViterbiStates(double[] observations)
Gets the most likely sequence of states using Viterbi algorithm (global decoding), given the observations and the underlying hidden Markov model.
Parameters:
observations - the observations
Returns:
the most likely sequence of states