getViterbi {STAN} | R Documentation |
Given a Hidden Markov Model, the function calculates the most likely state path (viterbi) for one or more observation sequence.
getViterbi(hmm, obs=list(), NAtol=5, emissionProbs=list(), verbose=FALSE, sizeFactors=matrix(1, nrow=length(obs), ncol=ncol(obs[[1]])))
hmm |
The initial Hidden Markov Model. |
obs |
The observations. A list of one or more entries containing the observation matrix ( |
NAtol |
Successive positions having NAs longer than this threshold are masked in the viterbi path. |
emissionProbs |
List of precalculated emission probabilities of emission function is of type 'null'. |
verbose |
|
sizeFactors |
Library size factors for Emissions PoissonLogNormal or NegativeBinomial as a length(obs) x ncol(obs[[1]]) matrix. |
A list containint the vterbi paths.
data(example) hmm_ex = initHMM(observations, nStates=3, method="Gaussian") hmm_fitted = fitHMM(observations, hmm_ex) viterbi = getViterbi(hmm_fitted, observations)