Report a bug
If you spot a problem with this page, click here to create a GitHub issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

mir.stat.distribution.f

This module contains algorithms for the F Distribution.
License:
Authors:
John Michael Hall
pure nothrow @nogc @safe T fPDF(T)(const T x, const T df1, const T df2)
if (isFloatingPoint!T);
Computes the F probability density function (PDF).
Parameters:
T x value to evaluate PDF
T df1 degrees of freedom parameter #1
T df2 degrees of freedom parameter #2
See Also:
Examples:
import mir.test: shouldApprox;

0.50.fPDF(1, 1).shouldApprox == 0.3001054;
0.75.fPDF(1, 2).shouldApprox == 0.2532039;
0.25.fPDF(0.5, 4).shouldApprox == 0.4904035;
0.10.fPDF(2, 1).shouldApprox == 0.7607258;
0.00.fPDF(1, 3).shouldApprox == double.infinity;
pure nothrow @nogc @safe T fCDF(T)(const T x, const T df1, const T df2)
if (isFloatingPoint!T);
Computes the F cumulative distribution function (CDF).
Parameters:
T x value to evaluate CDF
T df1 degrees of freedom parameter #1
T df2 degrees of freedom parameter #2
See Also:
Examples:
import mir.test: shouldApprox;

0.50.fCDF(1, 1).shouldApprox == 0.3918266;
0.75.fCDF(1, 2).shouldApprox == 0.522233;
0.25.fCDF(0.5, 4).shouldApprox == 0.5183719;
0.10.fCDF(2, 1).shouldApprox == 0.08712907;
pure nothrow @nogc @safe T fCCDF(T)(const T x, const T df1, const T df2)
if (isFloatingPoint!T);
Computes the F complementary cumulative distribution function (CCDF).
Parameters:
T x value to evaluate CCDF
T df1 degrees of freedom parameter #1
T df2 degrees of freedom parameter #2
See Also:
Examples:
import mir.test: shouldApprox;

0.50.fCCDF(1, 1).shouldApprox == 0.6081734;
0.75.fCCDF(1, 2).shouldApprox == 0.477767;
0.25.fCCDF(0.5, 4).shouldApprox == 0.4816281;
0.10.fCCDF(2, 1).shouldApprox == 0.9128709;
pure nothrow @nogc @safe T fInvCDF(T)(const T p, const T df1, const T df2)
if (isFloatingPoint!T);
Computes the F inverse cumulative distribution function (InvCDF).
Parameters:
T p value to evaluate InvCDF
T df1 degrees of freedom parameter #1
T df2 degrees of freedom parameter #2
See Also:
Examples:
import mir.test: shouldApprox;

0.3918266.fInvCDF(1, 1).shouldApprox == 0.50; 
0.522233.fInvCDF(1, 2).shouldApprox == 0.75;
0.5183719.fInvCDF(0.5, 4).shouldApprox == 0.25;
0.08712907.fInvCDF(2, 1).shouldApprox == 0.10;
0.0.fInvCDF(1, 1).shouldApprox == 0;
1.0.fInvCDF(1, 1).shouldApprox == double.infinity;
pure nothrow @nogc @safe T fLPDF(T)(const T x, const T df1, const T df2)
if (isFloatingPoint!T);
Computes the F log probability density function (LPDF).
Parameters:
T x value to evaluate LPDF
T df1 degrees of freedom parameter #1
T df2 degrees of freedom parameter #2
See Also:
Examples:
import mir.math.common: log;
import mir.test: shouldApprox;

0.50.fLPDF(1, 1).shouldApprox == log(0.3001054);
0.75.fLPDF(1, 2).shouldApprox == log(0.2532039);
0.25.fLPDF(0.5, 4).shouldApprox == log(0.4904035);
0.10.fLPDF(2, 1).shouldApprox == log(0.7607258);
0.00.fLPDF(1, 3).shouldApprox == double.infinity;