fInverseCdf

Evaluates the inverse of the F distribution function.

Synopsis

fInverseCdf (p, dfNumerator, dfDenominator)

Required Arguments

float p (Input)
Probability for which the inverse of the F distribution function is to be evaluated. The argument p must be in the open interval (0.0, 1.0).
float dfNumerator (Input)
Numerator degrees of freedom. Argument dfNumerator must be positive.
float df_denominator (Input)
Denominator degrees of freedom. Argument dfDenominator must be positive.

Return Value

The value of the inverse of the F distribution function evaluated at p. The probability that an F random variable takes a value less than or equal to fInverseCdf is p.

Description

The function fInverseCdf evaluates the inverse distribution function of a Snedecor’s F random variable with \(\nu_1\) = dfNumerator numerator degrees of freedom and \(\nu_2\) = dfDenominator denominator degrees of freedom. The function is evaluated by making a transformation to a beta random variable and then by evaluating the inverse of an incomplete beta function. If X is an F variate with \(\nu_1\) and \(\nu_2\) degrees of freedom and \(Y=(\nu_1,X)/(\nu_2+\nu_1 X)\), then Y is a beta variate with parameters \(p=\nu_1/2\) and \(q=\nu_2/2\). If \(P\leq 0.5\), fInverseCdf uses this relationship directly; otherwise, it also uses a relationship between F random variables that can be expressed as follows:

\[F_F(f, ν_1, ν_2) = 1 − F_F(1/f, ν_2 , ν_1)\]

Example

In this example, the 99-th percentage point is calculated for an F random variable with seven degrees of freedom. The same calculation is made for a similar variable with one degree of freedom.

from __future__ import print_function
from numpy import *
from pyimsl.math.fInverseCdf import fInverseCdf

df_denominator = 1.0
df_numerator = 7.0
p = 0.99

f = fInverseCdf(p, df_numerator, df_denominator)
print("The F(7,1) 0.01 critical value is %6.3f" % (f))

Output

The F(7,1) 0.01 critical value is 5928.356

Fatal Errors

INVERSE_OVERFLOW Function fInverseCdf is set to machine infinity since overflow would occur upon modifying the inverse value for the F distribution with the result obtained from the inverse beta distribution.