build_design: Build the BLIN design matrix

Description Usage Arguments Details Value See Also Examples

View source: R/design_matrix.R

Description

Build the BLIN design matrix

Usage

1
build_design(Y, X = NULL, lag = 1, showWarnings = TRUE)

Arguments

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.

Details

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.

Value

A sparse design matrix

See Also

generate_blin blin_mle

Examples

1
2
3
4
5
6
7
8
9
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)

blin documentation built on May 2, 2019, 7:05 a.m.