| hmm_viterbi {mlpack} | R Documentation |
A utility for computing the most probable hidden state sequence for Hidden Markov Models (HMMs). Given a pre-trained HMM and an observed sequence, this uses the Viterbi algorithm to compute and return the most probable hidden state sequence.
hmm_viterbi(input, input_model, verbose = FALSE)
input |
Matrix containing observations (numeric matrix). |
input_model |
Trained HMM to use (HMMModel). |
verbose |
Display informational messages and the full list of parameters and timers at the end of execution. Default value "FALSE" (logical). |
This utility takes an already-trained HMM, specified as "input_model", and evaluates the most probable hidden state sequence of a given sequence of observations (specified as '"input", using the Viterbi algorithm. The computed state sequence may be saved using the "output" output parameter.
A list with several components:
output |
File to save predicted state sequence to (integer matrix). |
mlpack developers
# For example, to predict the state sequence of the observations "obs" using # the HMM "hmm", storing the predicted state sequence to "states", the # following command could be used: ## Not run: output <- hmm_viterbi(input=obs, input_model=hmm) states <- output$output ## End(Not run)