2.3 Matrix Form 2
In this form, we have the explanatory variables in a matrix on the right of our parameter matrix as in Form 1b but we arrange everything a little differently: [stack.loss1stack.loss2stack.loss3stack.loss4]=[β0000β0000β0000β][air1air2air3air4]+[αααα]+[e1e2e3e4] Work through the matrix algebra to make sure you understand why Equation (2.7) is the same as Equation (2.1) for all the i data points together.
We will write Form 2 succinctly as y=Zx+a+e
2.3.1 Form 2 with multiple explanatory variables
The x is a column vector of the explanatory variables. If we have more explanatory variables, we add them to the column vector at the bottom. So if we had air flow, water temperature and acid concentration as explanatory variables, x looks like [air1air2air3air4water1water2water3water4acid1acid2acid3acid4] Add columns to the Z matrix for each new variable. [β1000β2000β30000β1000β2000β30000β1000β2000β30000β1000β2000β3] The number of rows of Z is always n, the number of rows of y, because the number of rows on the left and right of the equal sign must match. The number of columns in Z is determined by the size of x. Each explanatory variable (like air flow and wind) appears n times (air1, air2, …, airn, etc). So if the number of explanatory variables is k, the number of columns in Z is k×n. The a column matrix holds the intercept terms.
2.3.2 When does Form 2 arise?
Form 2 is similar to how multivariate time series models are typically written for reading by humans (on a whiteboard or paper). In these models, we see equations like this:
[y1y2y3y4]t=[βaβbβa0.1βbβa0βa][x1x2]t+[aaaa]+[e1e2e3e4]t
In this case, yt is the set of four observations at time t and xt is the set of two explanatory variables at time t. The Z is showing how we are modeling the effects of x1 and x2 on the ys. Notice that the effects are not consistent across the x and y. This model would not be possible to fit with lm()
but will be easy to fit with MARSS()
.