BayesPen.lm: Variable Selection via Penalized Credible Regions for Linear...

Description Usage Arguments Value Author(s) References Examples

Description

Fits a Bayesian linear model and performs variable selection via penalized credible regions (Bondell and Reich 2012).

Usage

1
2
BayesPen.lm(y, x, prior, nIter=500, burnIn=100, joint, force = NULL,
		    max.steps = NULL, max.refit)

Arguments

y

A n-vector of responses.

x

A n x p design matrix. An intercept is automatically added.

prior

A list specifying the priors for the regression coefficients and the error variance. The four elements of the list are a1, b1, a2, and b2. The residuals are assumed to be iid normal mean 0 with with a gamma(a1,b1) hyperprior on the precision. The regression coeficients are iid mean 0 and have a gamma(a2,b2) hyperprior on the precision.

nIter

The number of MCMC iterations (integer).

burnIn

The number of MCMC iterations to be discarded as burnin (integer).

joint

Indicator if joint credible regions approach should be used. If joint=FALSE the marginal approach of Bondell and Reich (2012) will be used.

force

An optional vector indexing which covariates variables should be forced into the model.

max.steps

Maximum number of steps to be performed in the LARS algorithm (Hastie and Efron 2013).

max.refit

The maximum number of models to be refit.

Value

joint.path

A complete solution path for the joint credible regions approach. Each row is a model in the solution path with a 1 indicating a variable is included and a 0 indicating it is not included.

marginal.path

A complete solution path for the marginal credible regions approach. The p-vector denotes the step at which each covariate is included in the model.

order.path

The action returned from lars that shows when each covariate is added to the model.

order.marg

The the covariate added at each step.

joint

Returns a vector indicating which variables are forced into the model.

force

Returns the logical joint.

coefs

A matrix of regression coefficients for each model in the solution path. The regression coefficients for parameters omitted from a model are set to 0.

SSE

SSE of each refitted model.

dev

Deviance of each refitted model.

df

Error degrees of freedom from each refitted model.

lm

Full fitting of the model.

Author(s)

Ander Wilson, Howard D. Bondell, and Brian J. Reich

References

Bondell, H. D. and Reich, B. J. (2012). Consistent high-dimensional Bayesian variable selection via penalized credible regions. J. Am. Statist. Assoc. 107, 1610-1624.

Examples

1
2
3
4
set.seed(1234)
dat <- SimExample(500,model="BR1")
fit.BRnew <- BayesPen.lm(y=dat$y,x=dat$X)
BayesPen.plot(fit.BRnew)

AnderWilson/BayesPen documentation built on May 5, 2019, 4:56 a.m.