Learn R Programming

dlbayes (version 0.1.0)

dlvs: Title Do Bayesian variable selection via penalized credible region

Description

This is a function using the algorithm doing variable selection via penalized credible interval proposed by Bondell et al. (2012). The computation of the proposed sequence is doing matrix computing and using existing LASSO software.

Usage

dlvs(dlresult)

Arguments

dlresult

Posterior samples of beta. A large matrix (nmc/thin)*p

Value

betatil

Variable selection result of beta, a p*1 vector. Most of the values shrinks to 0

Examples

Run this code
# NOT RUN {
{
p=30
n=5
#generate x
x=matrix(rnorm(n*p),nrow=n)
#generate beta
beta=c(rep(0,10),runif(n=5,min=-1,max=1),rep(0,10),runif(n=5,min=-1,max=1))
#generate y
y=x%*%beta+rnorm(n)
hyper=dlhyper(x,y)
dlresult=dl(x,y,hyper=hyper)
dlvs(dlresult)
}
# }

Run the code above in your browser using DataLab