Obtain posterior predictive/credible intervals from a spike-and-slab model
# S3 method for spikeSlabGAM
predict(
object,
newdata = NULL,
type = c("response", "link", "terms"),
terms = NULL,
aggregate = mean,
quantiles = NULL,
addIntercept = is.null(terms),
...
)
a spikeSlabGAM
model
an optional data.frame
on which to evaluate
predictions. Defaults to NULL, in which case the fitted values for the
original data are returned
the type of prediction required. The default is on the scale of
response, the alternative 'link'
is on the scale of the linear
predictor. Specifying 'terms'
returns a list giving the linear
predictors of the terms specified in terms
.
an optional character vector of term labels or variable names for which to return fits/predictions/credible regions. If variable names instead of term labels are supplied, the function returns predictions/estimates for all terms associated with these variables, i.e. their main effects (usually both linear and smooth for numeric covariates) and all interaction terms they are involved in.
(function) the summary statistic of the posterior predictive
of the linear predictor. Defaults to mean
.
(numeric) an optional vector of quantiles for borders of credible regions of the returned values. Defaults to NULL.
include global intercept term in prediction/estimate?
Defaults to TRUE if terms = NULL
.
arguments passed from or to other methods (not used)
If type ="terms"
, a list of data.frame
s containing the
requested pointwise summary statistics for the supplied terms (use e.g.
Reduce("+", ...)
to get row-wise sums of the list-entries).
Otherwise, a data.frame
containing the requested pointwise summary
statistics of the posterior predictive of the linear predictor
(type ="link"
) or the conditional expectation of the response
(type ="response"
) is returned.