2.2 Linear constraints

Your model can have simple linear constraints within all the parameters except \(\mathbf{Q}\), \(\mathbf{R}\) and \(\boldsymbol{\Lambda}\). For example \(1+2a-3b\) is a linear constraint. When entering this value for you matrix, you specify this as "1+2*a+-3*b". NOTE: +’s join parts so use +-3*b to specify \(-3b\). Anything after * is a parameter. So 1*1 has a parameter called "1". Example, let’s change the matrices in the previous model to: \[\begin{equation*} \mathbf{B} = \begin{bmatrix}b-0.1&0\\ 0&b+0.1\end{bmatrix}\quad \mathbf{Q} = \begin{bmatrix}q_{11}&0\\ 1&0\end{bmatrix}\quad \mathbf{Z} = \begin{bmatrix}z_1-z_2&2 z_1\\ 0&z_1\\ z_2&0\end{bmatrix} \end{equation*}\]

This would be specified as (notice "1*z1+-1*z2" for z1-z2):

B1 <- matrix(list("-0.1+1*b", 0, 0, "0.1+1*b"), 2, 2)
Q1 <- matrix(list("q11", 0, 0, 1), 2, 2)
Z1 <- matrix(list("1*z1+-1*z2", 0, "z2", "2*z1", "z1", 0), 3, 
    2)
model.list <- list(B = B1, U = U1, Q = Q1, Z = Z1, A = A1, R = R1, 
    x0 = pi1, V0 = V1, tinitx = 0)

You can call toLatex() on your model to make sure you and MARSS() agree on what model you are trying to fit:

fit <- MARSS(data, model=model.list)
toLatex(fit$model)