gam_loglikelihood: Compute negative log-likelihood of gamma HMM parameters

Description Usage Arguments Value

View source: R/gam_loglikelihood.R

Description

This function computes the negative log-likelihood that the given gamma HMM parameters could have generated the data being fit.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
gam_loglikelihood(
  working_params,
  x,
  design,
  num_states,
  num_variables,
  num_subjects,
  num_covariates,
  state_dep_dist_pooled = FALSE
)

Arguments

working_params

A vector of the working gamma parameters for the HMM.

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.

design

A list of design matrices for each subject with each row indicating the time and each column indicating the value of the covariate.

num_states

The number of states in the desired HMM.

num_variables

The number of variables in the data.

num_subjects

The number of subjects/trials that generated the data.

num_covariates

The number of covariates in the data that the transition probability matrix depends on.

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 number indicating the negative loglikelihood


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