Title: | L1-Ball Prior for Sparse Regression |
---|---|
Description: | Provides function for the l1-ball prior on high-dimensional regression. The main function, l1ball(), yields posterior samples for linear regression, as introduced by Xu and Duan (2020) <arXiv:2006.01340>. |
Authors: | Maoran Xu and Leo L. Duan |
Maintainer: | Maoran Xu <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.1.0 |
Built: | 2024-11-23 06:24:41 UTC |
Source: | CRAN |
This package provides an implementation of the Gibbs sampler, for using l1-ball prior with the regression likelihood .
y |
A data vector, n by 1 |
X |
A design matrix, n by p |
b_w |
The parameter in |
step |
Number of steps to run the Markov Chain Monte Carlo |
burnin |
Number of burn-ins |
b_lam |
The parameter in |
The posterior sample collected from the Markov Chain:
trace_theta:
trace_NonZero: The non-zero indicator
trace_Lam:
trace_Sigma:
n = 60 p = 100 X <- matrix(rnorm(n*p),n,p) d = 5 w0 <- c(rep(0, p-d), rnorm(d)*0.1+1) y = X%*% w0 + rnorm(n,0,.1) trace <- l1ball(y,X,steps=2000,burnin = 2000) plot(colMeans(trace$trace_theta))
n = 60 p = 100 X <- matrix(rnorm(n*p),n,p) d = 5 w0 <- c(rep(0, p-d), rnorm(d)*0.1+1) y = X%*% w0 + rnorm(n,0,.1) trace <- l1ball(y,X,steps=2000,burnin = 2000) plot(colMeans(trace$trace_theta))