viterbi {LaMa} | R Documentation |
Viterbi algorithm for decoding states
Description
Viterbi algorithm for decoding states
Usage
viterbi(delta, Gamma, allprobs)
Arguments
delta |
Initial or stationary distribution of length N |
Gamma |
Transition probability matrix of dimension c(N,N) |
allprobs |
Matrix of state-dependent probabilities/ density values of dimension c(n, N) |
Value
Vector of decoded states of length n
Examples
delta = c(0.5, 0.5)
Gamma = matrix(c(0.9, 0.1, 0.2, 0.8), nrow = 2, byrow = TRUE)
allprobs = matrix(runif(200), nrow = 100, ncol = 2)
states = viterbi(delta, Gamma, allprobs)
[Package LaMa version 1.0.0 Index]