Stats distributions studentpdf - CyrilB1531/lodestar GitHub Wiki
Home › Stats › Distribution tails
Distributions.StudentPdf
Student's t density.
public static double StudentPdf(double t, double df)
Parameters — t is the point; NaN answers NaN. df is the degrees of freedom, which must be positive; +∞ is the standard normal law, as scipy's is.
Returns — scipy.stats.t.pdf(t, df); from df 1e20 the normal density times 1 + (t⁴ − 2t² − 1)/(4 df), as the tail takes its own first term, and past t²/df = 1e308, where scipy's overflows to 0, the density itself (StudentPdf(1e140, 1e-30) is 5e-171) (#1690).
Exceptions — ArgumentOutOfRangeException when df is not positive, NaN included.
Example — the density at the centre and two units out, on five degrees of freedom.
using Lodestar.Stats;
double centre = Distributions.StudentPdf(0.0, 5.0); // => 0.379606…
double twoOut = Distributions.StudentPdf(2.0, 5.0); // => 0.065090…
Remarks — Formed in logs to 106 bits and rounded once: log B(½, ν/2), whose large-shape form subtracts no two log-gammas of order ν log ν, and log(1 + t²/ν), each in double-double. As one double exponential of some 620 nats, StudentPdf(204.2, 240.09) read 1.5e-13 off.
Applies to — net10.0, netstandard2.0.
See also — Distributions.StudentCdf, Distributions.StudentSf.