hs_gibbs: Gibbs sampler of horseshoe regression

View source: R/RcppExports.R

hs_gibbsR 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 TRUE, use prior scaled by σ.

Details

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)

Author(s)

Jingyu He

See Also

summary.mcmc

Examples

x = matrix(rnorm(1000), 100, 10)
y = x %*% rnorm(10) + rnorm(100)
fit=hs_gibbs(y, x, 1000, 1, 1, TRUE)
summary(fit)

bayeslm documentation built on June 28, 2022, 1:05 a.m.