dlvs: Title Do Bayesian variable selection via penalized credible...

Description Usage Arguments Value Examples

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

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
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)
}

dlbayes documentation built on May 2, 2019, 8:28 a.m.