prep.measurement: Prepare the measurement recipe

View source: R/dynrRecipe.R

prep.measurementR Documentation

Prepare the measurement recipe

Description

Prepare the measurement recipe

Usage

prep.measurement(values.load, params.load = NULL, values.exo = NULL,
  params.exo = NULL, values.int = NULL, params.int = NULL, obs.names,
  state.names, exo.names)

Arguments

values.load

matrix of starting or fixed values for factor loadings. For models with regime-specific factor loadings provide a list of matrices of factor loadings.

params.load

matrix or list of matrices. Contains parameter names of the factor loadings.

values.exo

matrix or list of matrices. Contains starting/fixed values of the covariate regression slopes.

params.exo

matrix or list of matrices. Parameter names of the covariate regression slopes.

values.int

vector of intercept values specified as matrix or list of matrices. Contains starting/fixed values of the intercepts.

params.int

vector of names for intercept parameters specified as a matrix or list of matrices.

obs.names

vector of names for the observed variables in the order they appear in the measurement model.

state.names

vector of names for the latent variables in the order they appear in the measurement model.

exo.names

(optional) vector of names for the exogenous variables in the order they appear in the measurement model.

Details

The values.* arguments give the starting and fixed values for their respective matrices. The params.* arguments give the free parameter labels for their respective matrices. Numbers can be used as labels. The number 0 and the character 'fixed' are reserved for fixed parameters.

When a single matrix is given to values.*, that matrix is not regime-switching. Correspondingly, when a list of length r is given, that matrix is regime-switching with values and params for the r regimes in the elements of the list.

Value

Object of class 'dynrMeasurement'

See Also

Methods that can be used include: print, printex, show

Examples

prep.measurement(diag(1, 5), diag("lambda", 5))
prep.measurement(matrix(1, 5, 5), diag(paste0("lambda_", 1:5)))
prep.measurement(diag(1, 5), diag(0, 5)) #identity measurement model

#Regime-switching measurement model where the first latent variable is
# active for regime 1, and the second latent variable is active for regime 2
# No free parameters are present.
prep.measurement(values.load=list(matrix(c(1,0), 1, 2), matrix(c(0, 1), 1, 2)))

dynr documentation built on May 29, 2024, 2:49 a.m.