predict.spikeSlabGAM {spikeSlabGAM}R Documentation

Obtain posterior predictive/credible intervals from a spike-and-slab model

Description

Obtain posterior predictive/credible intervals from a spike-and-slab model

Usage

## S3 method for class 'spikeSlabGAM'
predict(
  object,
  newdata = NULL,
  type = c("response", "link", "terms"),
  terms = NULL,
  aggregate = mean,
  quantiles = NULL,
  addIntercept = is.null(terms),
  ...
)

Arguments

object

a spikeSlabGAM model

newdata

an optional data.frame on which to evaluate predictions. Defaults to NULL, in which case the fitted values for the original data are returned

type

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.

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.

aggregate

(function) the summary statistic of the posterior predictive of the linear predictor. Defaults to mean.

quantiles

(numeric) an optional vector of quantiles for borders of credible regions of the returned values. Defaults to NULL.

addIntercept

include global intercept term in prediction/estimate? Defaults to TRUE if terms = NULL.

...

arguments passed from or to other methods (not used)

Value

If type ="terms", a list of data.frames 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.

Author(s)

Fabian Scheipl


[Package spikeSlabGAM version 1.1-19 Index]