hmm_viterbi: Hidden Markov Model (HMM) Viterbi State Prediction

View source: R/hmm_viterbi.R

hmm_viterbiR 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 = 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 "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)

mlpack documentation built on Oct. 29, 2022, 1:06 a.m.

Related to hmm_viterbi in mlpack...