l1ball {l1ball}R Documentation

Fit the L1 prior

Description

This package provides an implementation of the Gibbs sampler, for using l1-ball prior with the regression likelihood 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, p^{b_w}) for w, default b_w=1

step

Number of steps to run the Markov Chain Monte Carlo

burnin

Number of burn-ins

b_lam

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

Value

The posterior sample collected from the Markov Chain:

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

[Package l1ball version 0.1.0 Index]