Description Usage Arguments Value Author(s) References Examples
This function runs one-site Gibbs sampler for linear regression with Spike-and-Slab LASSO prior.
1 |
y |
A vector of continuous responses (n x 1). |
X |
The design matrix (n x p), without an intercept. |
a, b |
Parameters of the prior. |
lambda |
A two-dim vector = c(lambda0, lambda1). |
maxiter |
An integer which specifies the maximum number of iterations for MCMC. |
burn.in |
An integer which specifies the number of burn-in iterations for MCMC. |
initial.beta |
A vector of initial values of beta to used. If set to NULL, the LASSO solution with 10-fold cross validation is used. Default is NULL. |
sigma |
Noise standard deviation. Default is 1. |
A list, including matrix beta ((maxiter-burn.in) x p) and matrix gamma (maxiter-burn.in) x p, vector theta ((maxiter-burn.in) x 1)
Lizhen Nie lizhen@statistics.uchicago.edu, Veronika Rockova Veronika.Rockova@chicagobooth.edu
Nie, L., & Ročková, V. (2020). Bayesian Bootstrap Spike-and-Slab LASSO. arXiv:2011.14279.
1 2 3 4 5 6 7 8 9 10 11 12 13 | n = 50; p = 12;
truth.beta = c(1.3, 1.3, 1.3, 1.3);
truth.sigma = 1
data = Generate_data(truth.beta, p, n, truth.sigma = 1, rho = 0.6,"block",4)
y = data$y; X = data$X; beta = data$beta
# --------------- set parameters -----------------
lambda0 = 7; lambda1 = 0.15; lambda = c(lambda0, lambda1)
a = 1; b = p #beta prior for theta
# this is for demonstration of usage only
# in practice, you may want to use more iterations!
MCchain2 = Gibbs2(y, X, a, b, lambda, maxiter = 1000, burn.in = 100)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.