Stats distributions fishersnedecorpdf - CyrilB1531/lodestar GitHub Wiki
Development build. This page describes
main, not a released package. The latest published Lodestar.Stats is 0.5.0 โ read its documentation.
Home โบ Stats โบ Distribution tails
Distributions.FisherSnedecorPdf
The F density.
public static double FisherSnedecorPdf(double f, double numeratorDf, double denominatorDf)
Parameters โ f is the point; below zero the density is zero, NaN answers NaN, and +โ answers zero up to a numerator of two and NaN past it, as scipy's does. numeratorDf and denominatorDf are the two degrees of freedom, each of which must be positive and finite.
Returns โ scipy.stats.f.pdf(f, dfn, dfd).
Exceptions โ ArgumentOutOfRangeException when either degrees of freedom is not positive, NaN included. A df of 5e-324, whose half is not a double, is refused too (#1690).
Example โ the density at one, for a model with two regressors and twenty residual degrees of freedom.
using Lodestar.Stats;
double atOne = Distributions.FisherSnedecorPdf(1.0, 2.0, 20.0); // => 0.350493โฆ
Remarks โ At zero the density follows the first shape as scipy's does: infinite when numeratorDf < 2, finite at 2, zero above. Where numeratorDf ยท f overflows it is zero.
Past shapes of a million this is more exact than scipy's. The density reduces to y^a (1 โ y)^b / (B(a, b) f) with y = dโf/(dโf + dโ), both y and 1 โ y formed by division rather than one as one minus the other, and B from Stirling's series. scipy's own density is 5e-7 off at (1e8, 1e8) and 1e-5 at (1e10, 1) against a 60-digit reference, which this one holds to 1e-12.
Applies to โ net10.0, netstandard2.0.
See also โ Distributions.FisherSnedecorCdf, Distributions.FisherSnedecorSf.