viterbi {RHmm}R Documentation

Viterbi algorithm

Description

This function calculates the optimal hidden states sequence using Viterbi's algorithm

Usage

viterbi(HMM, obs)

Arguments

HMM a HMMClass or a HMMFitClass object
obs The vector, matrix, data frame, list of vectors or list of matrices of observations

Value

a viterbiClass object which is a list with:

States Sequence of hidden states in 1...nStates
logViterbiScore logarithm of the Viterbi's Score
logProbSeq logarithm of probability of having the sequence of states conditionally to having the observations

References

Among hundreds of tutorials, you can have a look to use
Phil Blunsom (2004) Hidden Markov Models. http://www.cs.mu.oz.au/460/2004/materials/hmm-tutorial.pdf

See Also

HMMSet, HMMFit

Examples

 data(n1d_3s)
 ResFit <- HMMFit(obs_n1d_3s, nStates=3)
 VitPath <- viterbi(ResFit, obs_n1d_3s)

[Package RHmm version 1.2.0 Index]