Description Usage Arguments Value Examples
View source: R/norm0_working_params.R
The function transforms the natural normal HMM parameters that have additional constraints into working parameters that incorporate the constraints.
1 2 3 4 5 6 7 8 9 10 | norm0_working_params(
num_states,
num_variables,
num_subjects,
mu,
sigma,
zweight,
beta,
delta
)
|
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 |
delta |
A list of the initial state distributions for each subject. |
A single vector containing working parameters.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.