/// <summary>
/// 분포의 확률 밀도
/// </summary>
/// <param name="x"></param>
/// <returns></returns>
public double Density(double x)
{
// TODO JVG we can probably do a better job for Cauchy special case
if (double.IsPositiveInfinity(_dof))
{
return(Normal.Density(_location, _scale, x));
}
var d = (x - _location) / _scale;
return(SpecialFunctions.Gamma((_dof + 1.0) / 2.0)
* Math.Pow(1.0 + (d * d / _dof), -0.5 * (_dof + 1.0))
/ SpecialFunctions.Gamma(_dof / 2.0)
/ Math.Sqrt(_dof * Math.PI)
/ _scale);
}