viterbi: Viterbi algorithm

View source: R/viterbi.R

viterbiR Documentation

Viterbi algorithm

Description

For a given model, reconstructs the most probable states sequence, using the Viterbi algorithm.

Usage

viterbi(m, newdata = NULL)

Arguments

m

An object moveHMM

newdata

An object moveData (optional)

Value

The sequence of most probable states.

References

Zucchini, W. and MacDonald, I.L. 2009. Hidden Markov Models for Time Series: An Introduction Using R. Chapman & Hall (London).

Examples

# m is a moveHMM object (as returned by fitHMM), automatically loaded with the package
m <- example$m

# reconstruction of states sequence
states <- viterbi(m)


moveHMM documentation built on May 31, 2023, 6:13 p.m.