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

View source: R/hmm_loglik.R

hmm_loglikR Documentation

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).

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.

Value

A list with several components:

log_likelihood

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

Author(s)

mlpack developers

Examples

# 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)

## End(Not run)

mlpack documentation built on Sept. 27, 2023, 1:07 a.m.

Related to hmm_loglik in mlpack...