ssGAMDesign {spikeSlabGAM} | R Documentation |
Generate design and model information for spikeSlabGAM
Description
This function generates the design matrix for a generalized additive (mixed)
model, based on smoothing spline ANOVA-like orthogonal decomposition of the
model terms and their interactions. It parses the formula given to
spikeSlabGAM
to provide all the arguments necessary for the
MCMC sampler.
Usage
ssGAMDesign(
formula,
data,
specials = c("u", "lin", "fct", "sm", "rnd", "mrf", "srf"),
minUniqueValues = 6,
lowRankInteractions = TRUE,
orthogonalizeInteractions = TRUE,
decomposition = NULL
)
Arguments
formula |
the model formula. Follows the usual R syntax described in
|
data |
|
specials |
a vector of the types of possible model terms. These must be
implemented as functions generating a design matrix with a label attribute.
See also |
minUniqueValues |
the minimal number of unique values a covariate has to have in order to not be treated as a factor. Defaults to 6. |
lowRankInteractions |
should a low-rank approximation of the design matrix for interaction terms based on a (truncated) spectral decomposition of the implied covariance matrix be used? defaults to TRUE. |
orthogonalizeInteractions |
should the design matrices for interaction terms be projected into the complement of the column space of the respective main effects? Can help separate marginal and interaction effects. Defaults to TRUE. |
decomposition |
which decomposition to use, see |
Details
Setting lowRankInteractions
to FALSE can result in very large models,
especially if higher-order interactions or interactions between terms with
lots of parameters are involved. Note that numeric covariates with fewer
unique values than minUniqueValues
are treated as factors unless
wrapped in a special argument.
This function is not meant to be called directly by the user,
spikeSlabGAM
is the user interface.
Value
a list with components:
response |
the left hand side of the model formula |
Design |
the design matrix of the model specified in formula |
groupIndicators |
a factor that maps the columns of
|
H |
a matrix containing the hierarchy of the penalization groups (not used, included for backwards compatibility) |
Author(s)
Fabian Scheipl