Accord.Statistics.Distributions.Univariate.TDistribution.TDistribution C# (CSharp) Method

TDistribution() public method

Initializes a new instance of the TDistribution class.
public TDistribution ( [ degreesOfFreedom ) : System
degreesOfFreedom [ The degrees of freedom.
return System
        public TDistribution([Positive] double degreesOfFreedom)
        {
            if (degreesOfFreedom < 1)
                throw new ArgumentOutOfRangeException("degreesOfFreedom");

            this.DegreesOfFreedom = degreesOfFreedom;

            double v = degreesOfFreedom;

            // TODO: Use LogGamma instead.
            this.constant = Gamma.Function((v + 1) / 2.0) / (Math.Sqrt(v * Math.PI) * Gamma.Function(v / 2.0));
        }