Stats 0.2.0 distributions studentsf - CyrilB1531/lodestar GitHub Wiki

Lodestar.Stats 0.2.0. This page is frozen at that release. Read the current documentation for what main says now. A link to a decision or a migration page follows main, and leaves the archive.

Distributions.StudentSf

The upper tail of Student's t: P(T > t).

public static double StudentSf(double t, double df)

Parameterst is the statistic. df is the degrees of freedom, which must be positive.

Returnsscipy.stats.t.sf(t, df).

ExceptionsArgumentOutOfRangeException when df is not positive, NaN included.

Example — one tail, and the two-sided p-value a regression table prints.

using Lodestar.Stats;

double upper = Distributions.StudentSf(2.0, 12.0);   // => 0.0343275…
double twoSided = 2.0 * upper;                        // => 0.0686550…

// Symmetric about zero, so the two tails of the same magnitude sum to one.
double whole = upper + Distributions.StudentSf(-2.0, 12.0);  // => 1

Remarksone tail, not two. A regression reports 2 × StudentSf(|t|, df) beside each coefficient, and doubling is the caller's step rather than this method's, because a one-sided test exists and would be wrong to double.

Accurate into the far tail, which is the reason this member is published rather than left to a caller's own approximation: the corpus behind it reaches 3.1e-24 and is compared relatively, so an implementation returning zero there fails rather than passing on an absolute tolerance.

df of NaN is refused rather than propagated. It fails every ordering, so a guard written as df <= 0 would have let it through and returned a NaN probability from a public method.

Applies to — net10.0, netstandard2.0.

See alsoDistributions.StudentQuantile, Distributions.FisherSf, TTest.