Learn R Programming

mlpack (version 3.4.2)

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 = FALSE)

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 "FALSE" (logical).

Value

A list with several components:

log_likelihood

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

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
# NOT RUN {
# For example, to compute the log-likelihood of the sequence "seq" with the
# pre-trained HMM "hmm", the following command may be used: 

# }
# NOT RUN {
hmm_loglik(input=seq, input_model=hmm)
# }

Run the code above in your browser using DataLab