Learn R Programming

spikeSlabGAM (version 1.1-7)

spikeAndSlab: Set up and sample a spike-and-slab prior model.

Description

This function sets up a spike-and-slab model for variable selection and model choice in generalized additive models and samples its posterior. It uses a blockwise Metropolis-within-Gibbs sampler and the redundant multiplicative parameter expansion described in the reference. This routine is not meant to be called directly by the user -- spikeSlabGAM provides a formula-based interface for specifying models and takes care of (most of) the housekeeping. Sampling of the chains is done in parallel using package parallel. A "SOCK" cluster is set up under Windows to do so (and closed after computations are done, I try to clean up after myself), see makeCluster etc. Use options(mc.cores=) to set the (maximal) number of processes forked by the parallelization. If options()$mc.cores is unspecified, it is set to 2.

Usage

spikeAndSlab(y, X,
    family = c("gaussian", "binomial", "poisson"),
    hyperparameters = list(), model = list(),
    mcmc = list(), start = list())

Arguments

y
response
X
design matrix
family
(character) the family of the response, defaults to normal/Gaussian response
hyperparameters
a list of hyperparameters controlling the priors (see details)
model
a list with information about the grouping structure of the model (see details)
mcmc
(optional) list setting arguments for the sampler (see details)
start
(optional) list containing the starting values for $\beta, \gamma, \tau^2, \sigma^2, w$ and, optionally, the random seed

Value

  • a list with components:[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Details

Details for model specification: [object Object],[object Object],[object Object],[object Object]

References

Scheipl, F. (2010) Normal-Mixture-of-Inverse-Gamma Priors for Bayesian Regularization and Model Selection in Structured Additive Regression Models. LMU Munich, Department of Statistics: Technical Reports, No.84 (http://epub.ub.uni-muenchen.de/11785/)