hmm_viterbi {mlpack} | R Documentation |
Hidden Markov Model (HMM) Viterbi State Prediction
Description
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.
Usage
hmm_viterbi(input, input_model, verbose = getOption("mlpack.verbose", FALSE))
Arguments
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 "getOption("mlpack.verbose", FALSE)" (logical). |
Details
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.
Value
A list with several components:
output |
File to save predicted state sequence to (integer matrix). |
Author(s)
mlpack developers
Examples
# 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)