Half-Student-t distribution
Story
The Half-Student-t distribution is a Student-t distribution truncated to only have nonzero probability density for values greater than or equal to the location of the peak.
Parameters
The Half-Student-t distribution is peaked at its location parameter \(\mu\). The peak’s width is dictated by scale parameter \(\sigma\), which is positive. Finally, the shape parameter, called “degrees of freedom,” is \(\nu\). This last parameter imparts the distribution with a heavy tail for small \(\nu\).
Support
The Half-Student-t distribution is supported on the set of all real numbers that are greater than or equal to \(\mu\), that is on \([\mu, \infty)\).
Probability density function
Moments
Mean: \(\mu + 2\sigma\sqrt{\frac{\nu}{\pi}}\,\frac{\Gamma\left(\frac{\nu+1}{2}\right)}{\Gamma\left(\frac{\nu}{2}\right)(\nu-1)}\) for \(\nu > 1\), otherwise undefined.
Variance: \(\sigma^2\left(\frac{\nu}{\nu - 2}-\frac{4\nu}{\pi(\nu-1)^2}\left(\frac{\Gamma\left(\frac{\nu+1}{2}\right)}{\Gamma\left(\frac{\nu}{2}\right)}\right)^2\right)\) for \(\nu > 2\). If \(1 < \nu < 2\), then the variance is infinite. If \(\nu \le 1\), the variance is undefined.
Usage
Package |
Syntax |
---|---|
NumPy |
|
SciPy sampling |
|
Stan sampling |
|
Stan rng |
|
Notes
In Stan, a Half-Student-t is defined by putting a lower bound of \(\mu\) on the variable and then using a Student-t distribution with location parameter \(\mu\).
Only the standard Student-t distribution (\(\mu = 0\) and \(\sigma = 1\)) is available in NumPy. You can still draw out of the Half-Student-t distribution by performing a transformation on the samples out of the standard Student-t distribution, as shown in the usage, above.
The Half-Student-t distribution is not available in SciPy. To compute the PDF for \(y \ge \mu\), use
2 * scipy.stats.t.pdf(y, nu, mu, sigma)
. To compute the CDF for \(y \ge \mu\), use2 * scipy.stats.t.cdf(y, nu, mu, sigma) - 1
.The Half-Student-t distribution with \(\mu = 0\) is a useful prior for nonnegative parameters. The parameter \(\nu\) of the Half-Student-t can be tuned to allow for a heavy tail (\(\nu\) close to 1) or a light tail (large \(\nu\)).