HalfStudentt distribution¶
Story¶
The HalfStudentt distribution is a Studentt distribution truncated to only have nonzero probability density for values greater than or equal to the location of the peak.
Parameters¶
The HalfStudentt 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 HalfStudentt 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)(\nu1)}\) for \(\nu > 1\), otherwise undefined.
Variance: \(\sigma^2\left(\frac{\nu}{\nu  2}\frac{4\nu}{\pi(\nu1)^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 HalfStudentt is defined by putting a lower bound of \(\mu\) on the variable and then using a Studentt distribution with location parameter \(\mu\).
Only the standard Studentt distribution (\(\mu = 0\) and \(\sigma = 1\)) is available in NumPy. You can still draw out of the HalfStudentt distribution by performing a transformation on the samples out of the standard Studentt distribution, as shown in the usage, above.
The HalfStudentt 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 HalfStudentt distribution with \(\mu = 0\) is a useful prior for nonnegative parameters. The parameter \(\nu\) of the HalfStudentt can be tuned to allow for a heavy tail (\(\nu\) close to 1) or a light tail (large \(\nu\)).