Description Usage Arguments Value Author(s) References See Also Examples
Run a gibbs sampler for a Bayesian sparse group selection model with spike and slab priors. This function is designed for an univariate response model and when the design matrix has a group structure.
1 2 3 4 |
Y |
A numerical vector representing the univariate response variable. |
X |
A matrix respresenting the design matrix of the linear regression model. |
group_size |
Integer vector representing the size of the groups of the design matrix |
niter |
Number of iteration for the Gibbs sampler. |
burnin |
Number of burnin iteration |
pi0 |
Initial value for pi0 which will be updated if |
pi1 |
Initial value for pi1 which will be updated if |
num_update |
Number of update regarding the scaling of the shrinkage parameter lambda which is calibrated by a Monte Carlo EM algorithm |
niter.update |
Number of itertion regarding the scaling of the shrinkage parameter lambda which is calibrated by a Monte Carlo EM algorithm |
alpha |
Shape parameter of the Inverse Gamma prior on the variance of the noise for the linear regression model. |
gamma |
Scale parameter of the Inverse Gamma prior on the variance of the noise for the linear regression model. |
a1 |
First shape parameter of the conjugate beta hyper-prior for |
a2 |
Second shape parameter of the conjugate beta prior for |
c1 |
First shape parameter of the conjugate beta hyper-prior for |
c2 |
Second shape parameter of the conjugate beta prior for |
pi_prior |
Logical. If "TRUE" beta priors are used for pi0 and pi1 |
BSGSSS
returns a list that contains the following components:
pos_mean |
The posterior mean estimate of the regression coefficients |
pos_median |
The posterior mean estimate of the regression coefficients |
coef |
A matrix with the regression coefficients sampled at each iteration |
Benoit Liquet, Matthew Sutton and Xiaofan Xu.
B. Liquet, K. Mengersen, A. Pettitt and M. Sutton. (2016). Bayesian Variable Selection Regression Of Multivariate Responses For Group Data. Submitted in Bayesian Analysis.
Xu, X. and Ghosh, M. (2015). Bayesian Variable Selection and Estimation for Group Lasso. Bayesian Analysis, 10(4): 909<e2><80><93>936.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## Simulation of datasets X and Y with group variables
set.seed(1)
data1 = gen_data_uni(nsample = 120,cor.var=0.5, ntrain = 80)
data1 = normalize(data1)
true_model <- data1$true_model
X <- data1$X
Y<- data1$Y
train_idx <- data1$train_idx
gsize <- data1$gsize
## We recommend to set niter=50000, burnin=10000
## num_update = 100 and niter.update = 100
## to reach convergence
model <- BSGSSS(Y[,1],X,niter=500,burnin=100,group_size=gsize,
num_update = 20,niter.update = 20)
model$pos_median!=0
true_model
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.