Description Usage Arguments Details Value References
View source: R/SBLM_run_chain.R
This function runs a Gibbs sampler for a Bayesian linear regression model that explicitly allows for sparse solutions, in the spirit of the spike and slab prior (Mitchell and Beauchamp 1988). The difference with this model is that, instead of putting a prior on the coefficients with a point mass at 0, we use binary auxiliary variables to mask the effect of a variable from the predicted values. More details about the model can be found in UPDATE THIS LINK WHEN POST IS UP.
1 | sblm_gibbs(X, y, hp = NULL, S, verbose = 0L)
|
X |
design matrix, of size |
y |
response vector of length |
hp |
list of hyperparameters. See Details for a description and default values used. |
S |
number of iterations for the chain. |
verbose |
integer. Function prints every |
The following hyperparameters can be supplied by the user through hp
.
Default values for all are 1, and tend to work well.
a_0_b
: shape parameter of Inv-Gamma prior for sigma_2_b.
b_0_b
: scale parameter of Inv-Gamma prior for sigma_2_b.
a_0_e
: shape parameter of Inv-Gamma prior for sigma_2_e.
b_0_e
: scale parameter of Inv-Gamma prior for sigma_2_e.
s_1_pi
: shape 1 parameter for Beta prior of pi_z.
s_2_pi
: shape 2 parameter for Beta prior of pi_z.
Note that the default values for the prior of pi_z imply a uniform distribution
on (0,1). If the number of columns in X
is large, and you suspect that
beta should be highly sparse, then reflecting this in the prior of pi_z would
speed up computation considerably.
A nested list with S
elements, each one being a list of the
values of the latent variables at every iteration.
Mitchell, Toby J, and John J Beauchamp. 1988. Bayesian Variable Selection in Linear Regression. Journal of the American Statistical Association, 83 (404). Taylor & Francis Group: 1023<e2><80><93>32.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.