Create model matrices
make_matrices(formulas, data, new_data = NULL, gam_args = NULL)
A list of
X_fe Design matrix for fixed effects
X_re Design matrix for random effects
S Smoothness matrix
log_det_S Vector of log-determinants of smoothness matrices
ncol_fe Number of columns of X_fe for each parameter
ncol_re Number of columns of X_re and S for each random effect
List of formulas (possibly nested, e.g. for use within Observation)
Data frame including covariates
Optional new data set, including covariates for which
the design matrices should be created. This needs to be passed in addition
to the argument 'data
', for cases where smooth terms or factor
covariates are included, and the original data set is needed to determine
the full range of covariate values.
Named list of additional arguments for mgcv::gam()
,
such as knots.