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 |
step |
Number of steps to run the Markov Chain Monte Carlo |
burnin |
Number of burn-ins |
b_lam |
The parameter in |
Value
The posterior sample collected from the Markov Chain:
trace_theta:
\theta
trace_NonZero: The non-zero indicator
1(\theta_i\neq 0)
trace_Lam:
\lambda_i
trace_Sigma:
\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))
[Package l1ball version 0.1.0 Index]