Package 'l1ball'

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

Help Index


Fit the L1 prior

Description

This package provides an implementation of the Gibbs sampler, for using l1-ball prior with the regression likelihood yi=Xiθ+ϵi,ϵiN(0,σ2)y_i = X_i\theta+ \epsilon_i, \epsilon_i\sim {N}(0,\sigma^2).

Arguments

y

A data vector, n by 1

X

A design matrix, n by p

b_w

The parameter in Beta(1,pbw)Beta(1, p^{b_w}) for ww, default bw=1b_w=1

step

Number of steps to run the Markov Chain Monte Carlo

burnin

Number of burn-ins

b_lam

The parameter in λiInverseGamma(1,bλ)\lambda_i \sim Inverse-Gamma(1, b_\lambda), default bλ=103b_\lambda=10^{-3}. To increase the level of shrinkage, use smaller bλb_\lambda.

Value

The posterior sample collected from the Markov Chain:

  • trace_theta: θ\theta

  • trace_NonZero: The non-zero indicator 1(θi0)1(\theta_i\neq 0)

  • trace_Lam: λi\lambda_i

  • trace_Sigma: σ2\sigma^2

Examples

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))