viterbi: Viterbi algorithm

View source: R/RHmm.R

viterbiR 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)

RHmm documentation built on Nov. 30, 2023, 7:22 p.m.

Related to viterbi in RHmm...