Constructs path matrices for dynamic structural equation model (DSEM) using a vector of parameters and specification of the DSEM
make_matrices(beta_p, model, times, variables)
A named list of matrices including:
The matrix of interactions, i.e., one-headed arrows
The matrix of exogenous covariance, i.e., two-headed arrows
vector parameters.
matrix or data.frame with the following columns, and one row per one-headed or two-headed arrow in the dynamic structural model:
whether a path coefficient is one-headed (1) or two-headed (2)
whether the lag associated with a given coefficient
starting value, used when parameter=0
The parameter number from beta_p
associated with a given path
The variable at the tail of a given path
The variable at the head of a given path
integer-vector of times to use when defining matrices
character-vector listing variables
When length(times)
is \(T\) and length(variables)
is \(J\),
make_matrices
returns matrices of dimension \(TJ \times TJ\) representing
paths among \(vec(\mathbf{X})\) where matrix \(\mathbf{X}\) has dimension
\(T \times J\) and \(vec\) stacks columns into a single long vector