Stats distributions - CyrilB1531/lodestar GitHub Wiki

Home › Stats › Distribution tails

Distributions

The density, both tails and both inverses of the standard normal, Student's t, F and chi-squared laws, as scipy.stats gives them.

public static class Distributions

Example — a coefficient's two-sided p-value and its 95% multiplier, the two numbers a regression table prints beside an estimate.

using Lodestar.Stats;

// A t of 2.0 on 12 residual degrees of freedom.
double twoSided = 2.0 * Distributions.StudentSf(2.0, 12.0);   // => 0.0686550…
double multiplier = Distributions.StudentQuantile(0.975, 12.0); // => 2.1788128296672298

// And the overall F test of a model with two regressors and twenty residual df.
double overall = Distributions.FisherSnedecorSf(4.0, 2.0, 20.0);        // => 0.0345716…

// And a log-rank test's p-value, on one degree of freedom.
double logRank = Distributions.ChiSquaredSf(3.84, 1.0);          // => 0.0500…

// The large-sample multiplier, where a Student one has no degrees of freedom to take.
double large = Distributions.NormalQuantile(0.975);              // => 1.959963…

Remarks — twenty members, Pdf, Cdf, Sf, Quantile (scipy's ppf) and Isf for each law. Five were published first because a sibling package asked for them, under decisions/0003; the other fifteen followed in #1158, so a caller writing their own test, interval or power calculation no longer leaves the package for the law underneath it. Each tail is evaluated on the side that keeps full relative precision, and the log-gamma, incomplete beta and gamma and their inverses stay internal. The index page has the history.

Applies to — net10.0, netstandard2.0.

See also — TTest, OneWayAnova, the distributions index.

Members

Member What it does
Distributions.ChiSquaredCdf The lower tail of the chi-squared distribution.
Distributions.ChiSquaredIsf The inverse of the chi-squared upper tail.
Distributions.ChiSquaredPdf The chi-squared density.
Distributions.ChiSquaredQuantile The value a chi-squared falls below with a given probability.
Distributions.ChiSquaredSf The upper tail of the chi-squared distribution.
Distributions.FisherSnedecorCdf The lower tail of the F distribution.
Distributions.FisherSnedecorIsf The inverse of the F upper tail.
Distributions.FisherSnedecorPdf The F density.
Distributions.FisherSnedecorQuantile The value an F falls below with a given probability.
Distributions.FisherSnedecorSf The upper tail of the F distribution.
Distributions.FisherSf Its former name, obsolete, kept for binaries compiled against 0.5.0.
Distributions.NormalCdf The lower tail of the standard normal.
Distributions.NormalIsf The inverse of the standard normal's upper tail.
Distributions.NormalPdf The standard normal density.
Distributions.NormalQuantile The value a standard normal falls below with a given probability.
Distributions.NormalSf The upper tail of the standard normal.
Distributions.StudentCdf The lower tail of Student's t.
Distributions.StudentIsf The inverse of Student's t upper tail.
Distributions.StudentPdf Student's t density.
Distributions.StudentQuantile The value a Student's t falls below with a given probability.
Distributions.StudentSf The upper tail of Student's t.