Learn R Programming

STAN (version 1.4.0)

getViterbi: Calculate the most likely state path

Description

Given a Hidden Markov Model, the function calculates the most likely state path (viterbi) for one or more observation sequence.

Usage

getViterbi(HMM, obs=list(), NAtol=5, emissionProbs=list(), verbose=FALSE)

Arguments

HMM
The initial Hidden Markov Model. This is a HMM.
obs
The observations. A list of one or more entries containing the observation matrix (numeric) for the samples (e.g. chromosomes).
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
logical for printing algorithm status or not.

Value

A list containint the vterbi paths.

See Also

HMM

Examples

Run this code
data(example)
hmm_fitted = fitHMM(observations, hmm_ex)
viterbi_hmm = getViterbi(hmm_fitted$hmm, observations)

Run the code above in your browser using DataLab