% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dist_horseshoe.R
\name{dist_horseshoe}
\alias{dist_horseshoe}
\title{The Horseshoe distribution}
\usage{
dist_horseshoe(lambda, tau)
}
\arguments{
\item{lambda}{A positive numeric vector of local scale parameters
\eqn{\lambda > 0} (one per observation).}

\item{tau}{A positive scalar global scale parameter \eqn{\tau > 0}.}
}
\description{
\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#stable}{\figure{lifecycle-stable.svg}{options: alt='[Stable]'}}}{\strong{[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.
}
\details{
We recommend reading this documentation on \href{https://pkg.mitchelloharawild.com/distributional/reference/dist_horseshoe.html}{pkgdown} which renders math nicely.
\url{https://pkg.mitchelloharawild.com/distributional/reference/dist_horseshoe.html}

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

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

\strong{Mean}: \eqn{E(X)} — not available in closed form.

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

\strong{Probability density function (p.d.f)}:

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

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

where the half-Cauchy hyperprior \eqn{\lambda \sim C^+(0, 1)} induces the
characteristic horseshoe shrinkage behaviour.
}
\examples{
dist <- dist_horseshoe(lambda = c(0.5, 1, 2), tau = 1)
dist

\dontshow{if (requireNamespace("LaplacesDemon", quietly = TRUE)) withAutoprint(\{ # examplesIf}
support(dist)
generate(dist, 10)

density(dist, 0)
density(dist, 0, log = TRUE)
\dontshow{\}) # examplesIf}
}
\references{
Carvalho, C.M., Polson, N.G., and Scott, J.G. (2008).
"The Horseshoe Estimator for Sparse Signals".
\emph{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".
\emph{Journal of Machine Learning Research}, 5, p. 73–80.
}
\seealso{
\code{\link[LaplacesDemon:dist.Horseshoe]{LaplacesDemon::dhs()}}, \code{\link[LaplacesDemon:dist.Horseshoe]{LaplacesDemon::rhs()}}
}
