Learn R Programming

bravo (version 3.2.1)

bits: Bayesian Iterated Screening (ultra-high, high or low dimensional).

Description

Perform Bayesian iterated screening in Gaussian regression models

Usage

bits(X, y, lam = 1, w = 0.5, pp = FALSE, max.var = nrow(X), verbose = TRUE)

Value

A list with components

model.pp

An integer vector of the screened model.

postprobs

The sequence of posterior probabilities until the last included variable.

lam

The value of lam, the slab precision parameter.

w

The value of w, the prior inclusion probability.

Arguments

X

An \(n\times p\) matrix. Sparse matrices are supported and every care is taken not to make copies of this (typically) giant matrix. No need to center or scale.

y

The response vector of length n.

lam

The slab precision parameter. Default: 1.

w

The prior inclusion probability of each variable. Default: 1/2.

pp

Boolean: If FALSE (default) the algorithm stops after including max.var many variables. If true, the posterior probability stopping rule is used.

max.var

The maximum number of variables to be included.

verbose

If TRUE (default) will show the variable index included in each iteration.

References

Wang, R., Dutta, S., Roy, V. (2021) Bayesian iterative screening in ultra-high dimensional settings. https://arxiv.org/abs/2107.10175

Examples

Run this code
n=50; p=100;
TrueBeta <- c(rep(5,3),rep(0,p-3))

rho <- 0.6
x1 <- matrix(rnorm(n*p), n, p)
X <- sqrt(1-rho)*x1 + sqrt(rho)*rnorm(n)
y <- 0.5 + X %*% TrueBeta + rnorm(n)
res<-bits(X,y, pp=TRUE)
res$model.pp # the vector of screened model
res$postprobs # the log (unnormalized) posterior probabilities corresponding to the model.pp.

Run the code above in your browser using DataLab