viterbi | R Documentation |
For a given model, reconstructs the most probable states sequence, using the Viterbi algorithm.
viterbi(m, hierarchical = FALSE)
m |
An object |
hierarchical |
Logical indicating whether or not to return a list of Viterbi-decoded states for each level of a hierarchical HMM. Ignored unless |
The sequence of most probable states. If hierarchical
is TRUE
, then a list of the most probable states for each level of the hierarchy is returned.
Zucchini, W. and MacDonald, I.L. 2009. Hidden Markov Models for Time Series: An Introduction Using R. Chapman & Hall (London).
# m is a momentuHMM object (as returned by fitHMM), automatically loaded with the package m <- example$m # reconstruction of states sequence states <- viterbi(m)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.