gam_viterbi: Global decoding by the Viterbi algorithm

Description Usage Arguments Value

View source: R/gam_viterbi.R

Description

This function takes in data x assumed to be generated by the HMM hmm and outputs the most likely sequence of states that could have generated the data using global decoding by the Viterbi algorithm.

Usage

1
gam_viterbi(x, hmm, state_dep_dist_pooled = FALSE)

Arguments

x

The data to be fit with an HMM in the form of a 3D array. The first index (row) corresponds to time, the second (column) to the variable number, and the third (matrix number) to the subject number.

hmm

A list of parameters that specify the gamma HMM, including num_states, num_variables, num_subjects, num_covariates, alpha, theta, gamma, delta.

state_dep_dist_pooled

A logical variable indiacting whether the state dependent distribution parameters alpha and theta should be treated as equal for all subjects.

Value

A matrix with each column containing the sequence of states for the given subject.


simonecollier/lizardHMM documentation built on Dec. 23, 2021, 2:24 a.m.