Thin helper that calls lori::covmat() without requiring users to
attach the lori package. It constructs the block-structured
covariate matrix \(X\) (with \(n \times p\) rows) from site-level
covariates R, year-level covariates C, and optional site–year
covariates E. Any of R, C, or E can be NULL
to omit that block.
Arguments
- n
Integer; number of sites.
- p
Integer; number of years.
- R
Optional numeric matrix with \(n\) rows and \(d_R\) columns (site-level covariates). Default:
NULL.- C
Optional numeric matrix with \(p\) rows and \(d_C\) columns (year-level covariates). Default:
NULL.- E
Optional numeric matrix with \(n p\) rows and \(d_E\) columns (site–year covariates; one row per site–year observation in the same order as \(X\)). Default:
NULL.- center
Logical; whether to center columns within each block (as in
lori::covmat). Default:FALSE.
Value
A numeric matrix with \(n \times p\) rows and
\(d = d_R + d_C + d_E\) columns (when present), identical to the value
returned by lori::covmat().