norm0_working_params: Transform normal HMM parameters from natural to working

Description Usage Arguments Value Examples

View source: R/norm0_working_params.R

Description

The function transforms the natural normal HMM parameters that have additional constraints into working parameters that incorporate the constraints.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
norm0_working_params(
  num_states,
  num_variables,
  num_subjects,
  mu,
  sigma,
  zweight,
  beta,
  delta
)

Arguments

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.

mu

A list of matrices containing the means of the state dependent normal distribution. Each matrix corresponds to a different variable, each row corresponds to a different subject and each column corresponds to a different state.

sigma

A list of matrices containing the standard deviations of the state dependent normal distribution. Each matrix corresponds to a different variable, each row corresponds to a different subject and each column corresponds to a different state.

beta

A matrix of regression coefficients for the effect of the covariates on the transition probability matrix gamma.

delta

A list of the initial state distributions for each subject.

Value

A single vector containing working parameters.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# define values of parameters
num_states    <- 2
num_variables <- 2
num_subjects  <- 2
mu            <- list(matrix(c(1, 5, 2, 4), 2, 2, byrow = TRUE),
                      matrix(c(1, 5, 2, 4), 2, 2, byrow = TRUE))
sigma         <- list(matrix(c(1, 2, 1, 1.5), 2, 2, byrow = TRUE),
                      matrix(c(1, 2, 1, 1.5), 2, 2, byrow = TRUE))
beta          <- matrix(c(-2, 0, 0), nrow = 1, ncol = 3)
delta         <- list(c(1/2, 1/2), c(1/2, 1/2))

#transform to working parametes
norm_working_params(num_states, num_variables, num_subjects,
                    mu, sigma, beta, delta)

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