build_design {blin} | R Documentation |
Build the BLIN design matrix
build_design(Y, X = NULL, lag = 1, showWarnings = TRUE)
Y |
Response 3-mode array. |
X |
Optional 4-mode array of covariates, defaults to no covariates. |
lag |
Optional numeric specifying autoregressive lag in model, defaults to 1. |
showWarnings |
Optional logical whether matrix memory size should be evaluated and warning provided (see details), defaults to TRUE. |
This function takes an S \times L \times T array Y that is a representation of a longitudinal bipartite relational data set.
Optional input is an S \times L \times T \times p array X of covariates that influence the evolution of the data set in equation over time.
The function returns an (SL(T - lag)) \times (S^2 + L^2 + p) design matrix, of sparse class, upon which Y[,,lag:T]
may be regressed.
If showWarnings = TRUE
, and if the estimated size of the design matrix is greater than 1GB, a warning is thrown.
|
A sparse design matrix |
S <- 5 L <- 4 tmax <- 10 data <- generate_blin(S,L,tmax, lag=2, sparse=.8, seed=1) dim(data$Y) Xreg <- build_design(data$Y, data$X, lag=2) dim(Xreg) class(Xreg)