hs_gibbs | R Documentation |
Standard Gibbs sampler of horseshoe regression.
hs_gibbs(Y, X, nsamps, a, b, scale_sigma_prior)
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 |
This function implements standard Gibbs sampler of horseshoe regression. The prior is y \mid β, σ^2, X \sim MVN(Xβ, σ^2 I) β_i \mid τ, λ_i, σ \sim N(0, λ_i^2τ^2σ^2) σ^2\sim IG(a, b) τ \sim C^{+}(0,1) λ_i \sim C^{+}(0,1)
Jingyu He
summary.mcmc
x = matrix(rnorm(1000), 100, 10) y = x %*% rnorm(10) + rnorm(100) fit=hs_gibbs(y, x, 1000, 1, 1, TRUE) summary(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.