Design Matrix Basics

ContentsIndex


Design Matrix Basics
Suppose that a single group of animals are being analyzed, with live recaptures and 5 capture occasions (making 4 re-encounter occasions, and hence 4 survival rates and 4 recapture parameters).  Suppose that the parameter matrices for each of these real parameters are specified as a Time Matrices.  Thus, the matrix for survival or Phi would be

  1  2  3  4 
     2  3  4 
        3  4 
           4 

and the matrix for recaptures, or p, would be

  5  6  7  8 
     6  7  8 
        7  8 
           8 

If you want to estimate each of these real parameters, the Identity matrix would be used for the design matrix, i.e.,

  1  0  0  0  0  0  0  0 
  0  1  0  0  0  0  0  0 
  0  0  1  0  0  0  0  0 
  0  0  0  1  0  0  0  0 
  0  0  0  0  1  0  0  0 
  0  0  0  0  0  1  0  0 
  0  0  0  0  0  0  1  0 
  0  0  0  0  0  0  0  1 

Each row corresponds to a real parameter, and in this case, each column also corresponds to a beta parameter.

Another design matrix that would estimate the same AIC value for the model, and thus the exact same real parameter estimates, but would reparameterize the beta parameter space is

  1  1  0  0  0  0  0  0 
  1  0  1  0  0  0  0  0 
  1  0  0  1  0  0  0  0 
  1  0  0  0  0  0  0  0 
  0  0  0  0  1  1  0  0 
  0  0  0  0  1  0  1  0 
  0  0  0  0  1  0  0  1 
  0  0  0  0  1  0  0  0 

This design matrix estimates an intercept term for each real parameter, and then an additional time effect for occasions 1, 2, and 3.  Note that the intercept corresponds to occasion 4.

Another example would be to estimate a mean of real parameter values across time, and then an offset for each of the 4 occasions.  The following matrix does this.

  1  1  0  0  0  0  0  0 
  1  0  1  0  0  0  0  0 
  1  0  0  1  0  0  0  0 
  1  -1  -1  -1  0  0  0  0 
  0  0  0  0  1  1  0  0 
  0  0  0  0  1  0  1  0 
  0  0  0  0  1  0  0  1 
  0  0  0  0  1  -1  -1  -1 

The first column corresponds to the mean Phi value, and columns 2-4 provide the time effects.  Likewise, column 5 provides the mean p, and columns 6-8 provide the time effects on p.

In all the examples shown so far, we have ignored the confounding of Phi(4) and p(5), i.e., only the product Phi(4)p(5) can be estimated.  We could eliminate p(5) by changing the parameter matrices, e.g., changing all the occurrences of parameter 8 to parameter 4.  However, another approach is to use the design matrix to make parameter 4 and parameter 8 equal, as is done in the following design matrix.  I started with an identity design matrix.

  1  0  0  0  0  0  0 
  0  1  0  0  0  0  0 
  0  0  1  0  0  0  0 
  0  0  0  1  0  0  0 
  0  0  0  0  1  0  0 
  0  0  0  0  0  1  0 
  0  0  0  0  0  0  1 
  0  0  0  1  0  0  0 

This design matrix only has 7 columns, but still 8 rows (because there are 8 parameters).  Note that column 4 corresponds to both parameter 4 (row 4) and parameter 8 (row 8).  Row 4 and row 8 are identical, making parameters 4 and 8 identical.

More advanced examples of the design matrix are shown in Design Matrix Advanced and Design Matrix Advanced 2.

Values in the design matrix should be scaled to achieve numerical convergence of the estimates.

Functions of the values in the design matrix can also be computed to create interactions.  The link function can be used to impose constraints on the range of the real parameters, and even force a set of them to sum to 1, or force a montonic increasing relationship in a set of real parameters.