hs_gibbs {bayeslm} | R Documentation |
Gibbs sampler of horseshoe regression
Description
Standard Gibbs sampler of horseshoe regression.
Usage
hs_gibbs(Y, X, nsamps, a, b, scale_sigma_prior)
Arguments
Y |
Response of regression. |
X |
Matrix of regressors. |
nsamps |
Number of posterior samples. |
a |
Parameter of inverse Gamma prior on |
b |
Parameter of inverse Gamma prior on |
scale_sigma_prior |
Bool, if |
Details
This function implements standard Gibbs sampler of horseshoe regression. The prior is
y \mid \beta, \sigma^2, X \sim MVN(X\beta, \sigma^2 I)
\beta_i \mid \tau, \lambda_i, \sigma \sim N(0, \lambda_i^2\tau^2\sigma^2)
\sigma^2\sim IG(a, b)
\tau \sim C^{+}(0,1)
\lambda_i \sim C^{+}(0,1)
Author(s)
Jingyu He
See Also
Examples
x = matrix(rnorm(1000), 100, 10)
y = x %*% rnorm(10) + rnorm(100)
fit=hs_gibbs(y, x, 1000, 1, 1, TRUE)
summary(fit)
[Package bayeslm version 1.0.1 Index]