dist_horseshoe: The Horseshoe distribution

View source: R/dist_horseshoe.R

dist_horseshoeR Documentation

The Horseshoe distribution

Description

[Stable]

The horseshoe distribution (Carvalho et al., 2008) is a heavy-tailed continuous distribution defined as a scale mixture of normals. It is primarily used as a shrinkage prior in sparse Bayesian regression, where it concentrates mass near zero while retaining heavy tails that leave large signals unshrunk.

Usage

dist_horseshoe(lambda, tau)

Arguments

lambda

A positive numeric vector of local scale parameters \lambda > 0 (one per observation).

tau

A positive scalar global scale parameter \tau > 0.

Details

We recommend reading this documentation on pkgdown which renders math nicely. https://pkg.mitchelloharawild.com/distributional/reference/dist_horseshoe.html

In the following, let X be a horseshoe random variable with local scale parameter lambda = \lambda > 0 and global scale parameter tau = \tau > 0.

Support: x \in \mathbb{R}, the set of all real numbers.

Mean: E(X) — not available in closed form.

Variance: \mathrm{Var}(X) — not available in closed form.

Probability density function (p.d.f):

The horseshoe density does not have a simple closed form but can be expressed as a scale mixture:

X \mid \lambda, \tau \sim \mathcal{N}(0,\, \lambda^2 \tau^2)

where the half-Cauchy hyperprior \lambda \sim C^+(0, 1) induces the characteristic horseshoe shrinkage behaviour.

References

Carvalho, C.M., Polson, N.G., and Scott, J.G. (2008). "The Horseshoe Estimator for Sparse Signals". Discussion Paper 2008-31. Duke University Department of Statistical Science.

Carvalho, C.M., Polson, N.G., and Scott, J.G. (2009). "Handling Sparsity via the Horseshoe". Journal of Machine Learning Research, 5, p. 73–80.

See Also

LaplacesDemon::dhs(), LaplacesDemon::rhs()

Examples

dist <- dist_horseshoe(lambda = c(0.5, 1, 2), tau = 1)
dist


support(dist)
generate(dist, 10)

density(dist, 0)
density(dist, 0, log = TRUE)


distributional documentation built on June 27, 2026, 5:06 p.m.