Parsing user-supplied formula to fixed-effect and kernel matrices.
parse_cvek_formula(
formula,
kern_func_list,
data,
data_new = NULL,
verbose = FALSE
)
(formula) A user-supplied formula.
(list) A list of kernel functions in the kernel library
(data.frame, n*d) A data.frame, list or environment (or object coercible by as.data.frame to a data.frame), containing the variables in formula. Neither a matrix nor an array will be accepted.
(data.frame, n_new*d) New data for computing predictions.
(logical) Whether to print additional messages.
A list of three slots:
(matrix, n*1) The vector of response variable.
(matrix, n*d_fix) The fixed effect matrix.
(list of matrices) A nested list of kernel term matrices. The first level corresponds to each base kernel function in kern_func_list, the second level corresponds to each kernel term specified in the formula.
The formula object is exactly like the formula for a GLM except that user can use k() to specify kernel terms. Additionally, user can specify interaction between kernel terms (using either '*' and ':'), and exclude interaction term by including -1 on the RHS of formula.