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. 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 dfDenominator (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

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, then 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|v_1, v_2) = 1 - F_F(1/f|v_2, v_1)\]

Example

This example finds the 99-th percentage point for an F random variable with 7 and 1 degrees of freedom.

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

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

Output

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

Fatal Errors

IMSLS_F_INVERSE_OVERFLOW Function fInverseCdf overflows. This is because dfNumerator or dfDenominator and p are too large. The return value is set to machine infinity.