FCDF Function

Evaluates the F distribution function. Using a keyword, the inverse of the F distribution function can be evaluated.

Usage

result = FCDF(f, dfnum, dfden)

Input Parameters

f—Expression for which the F distribution function is to be evaluated. A scalar or 1-dimensional vector.

dfnum—Numerator degrees of freedom. Argument dfnum must be positive.

dfden—Denominator degrees of freedom. Argument dfden must be positive.

Returned Value

result—The probability that an F random variable takes a value less than or equal to the input point f.

Input Keywords

Double—If present and nonzero, double precision is used.

Inverse—If present and nonzero, evaluates the inverse of the F distribution function. If inverse is specified, argument f represents the probability for which the inverse of the F distribution function is to be evaluated. In this case, f must be in the open interval (0.0, 1.0).

Discussion

Function FCDF evaluates the distribution function of a Snedecor’s F random variable with dfnum and dfden. The function is evaluated by making a transformation to a beta random variable and then evaluating the incomplete beta function. If X is an F variate with n1 and n2 degrees of freedom and Y = (n1X) / (n2 + n1X), then Y is a beta variate with parameters p = n1 / 2 and q = n2 / 2. The FCDF function also uses a relationship between F random variables that can be expressed as follows:

FF(f, n1, n2) = 1 – FF(1 / f, n2, n1)

where FF is the distribution function for an F random variable.

If the keyword Inverse is specified, the FCDF function evaluates the inverse distribution function of a Snedecor’s F random variable with n1 = dfnum numerator degrees of freedom and n2 = dfden denominator degrees of freedom. The function is evaluated by making a transformation to a beta random variable and then evaluating the inverse of an incomplete beta function.

Example 1

This example finds the probability that an F random variable with one numerator and one denominator degree of freedom is greater than 648.

f = 648
p = 1 - FCDF(f, 1, 1)
PM, p, Title = 'The probability that an F(1,1) ' + $
   'variate is greater than 648 is:'
; PV-WAVE prints the following:
; The probability that an F(1,1) variate is greater than 648 is:
; 0.0249959

Example 2

To use FCDF with arrays that are not 1-dimensional, create a temporary reformed version of your original array before calling FCDF, then reform the return result.

@waveadv
; Create a 3x2 array
array = RANDOMU(seed, 3, 2)
; Reform the 3x2 array into a 1-dimensional vector
vector = REFORM(array, 6)
; Use this 1-dimensional vector as input to FCDF
result_vector = FCDF(vector, 1, 1)
; Reform the 1-dimensional vector back into a 3x2 array
result_array = REFORM(result_vector, 3, 2)

Fatal Errors

STAT_F_INVERSE_OVERFLOW—Function FCDF 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.