Learn R Programming

mlpack (version 4.6.0)

hmm_loglik: Hidden Markov Model (HMM) Sequence Log-Likelihood

Description

A utility for computing the log-likelihood of a sequence for Hidden Markov Models (HMMs). Given a pre-trained HMM and an observation sequence, this computes and returns the log-likelihood of that sequence being observed from that HMM.

Usage

hmm_loglik(input, input_model, verbose = getOption("mlpack.verbose", FALSE))

Value

A list with several components:

log_likelihood

Log-likelihood of the sequence. Default value "0" (numeric).

Arguments

input

File containing observations (numeric matrix).

input_model

File containing HMM (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).

Author

mlpack developers

Details

This utility takes an already-trained HMM, specified with the "input_model" parameter, and evaluates the log-likelihood of a sequence of observations, given with the "input" parameter. The computed log-likelihood is given as output.

Examples

Run this code
# For example, to compute the log-likelihood of the sequence "seq" with the
# pre-trained HMM "hmm", the following command may be used: 

if (FALSE) {
hmm_loglik(input=seq, input_model=hmm)
}

Run the code above in your browser using DataLab