View source: R/decoding_functions.R
| viterbi_g | R Documentation |
The Viterbi algorithm decodes the most probable state sequence of an HMM.
viterbi_g(delta, Gamma, allprobs, trackID = NULL, mod = NULL)
delta |
initial distribution; either
|
Gamma |
array of transition probability matrices of dimension |
allprobs |
matrix of state-dependent probabilities or density values of dimension |
trackID |
optional vector of length |
mod |
optional model object containing |
vector of decoded states of length nObs
Other decoding functions:
stateprobs(),
stateprobs_g(),
stateprobs_p(),
viterbi(),
viterbi_p()
delta = c(0.5, 0.5)
Gamma = tpm_g(runif(10), matrix(c(-2,-2,1,-1), nrow = 2))
allprobs = matrix(runif(20), nrow = 10, ncol = 2)
states = viterbi_g(delta, Gamma[,,-1], allprobs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.