g01ed returns the probability for the lower or upper tail of the $F$ or variance-ratio distribution with real degrees of freedom.

# Syntax

C#
```public static double g01ed(
string tail,
double f,
double df1,
double df2,
out int ifail
)```
Visual Basic
```Public Shared Function g01ed ( _
tail As String, _
f As Double, _
df1 As Double, _
df2 As Double, _
<OutAttribute> ByRef ifail As Integer _
) As Double```
Visual C++
```public:
static double g01ed(
String^ tail,
double f,
double df1,
double df2,
[OutAttribute] int% ifail
)```
F#
```static member g01ed :
tail : string *
f : float *
df1 : float *
df2 : float *
ifail : int byref -> float
```

#### Parameters

tail
Type: System..::..String
On entry: indicates whether an upper or lower tail probability is required.
${\mathbf{tail}}=\text{"L"}$
The lower tail probability is returned, i.e., $P\left(F\le f:{\nu }_{1},{\nu }_{2}\right)$.
${\mathbf{tail}}=\text{"U"}$
The upper tail probability is returned, i.e., $P\left(F\ge f:{\nu }_{1},{\nu }_{2}\right)$.
Constraint: ${\mathbf{tail}}=\text{"L"}$ or $\text{"U"}$.
f
Type: System..::..Double
On entry: $f$, the value of the $F$ variate.
Constraint: ${\mathbf{f}}\ge 0.0$.
df1
Type: System..::..Double
On entry: the degrees of freedom of the numerator variance, ${\nu }_{1}$.
Constraint: ${\mathbf{df1}}>0.0$.
df2
Type: System..::..Double
On entry: the degrees of freedom of the denominator variance, ${\nu }_{2}$.
Constraint: ${\mathbf{df2}}>0.0$.
ifail
Type: System..::..Int32%
On exit: ${\mathbf{ifail}}={0}$ unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).

#### Return Value

g01ed returns the probability for the lower or upper tail of the $F$ or variance-ratio distribution with real degrees of freedom.

# Description

The lower tail probability for the $F$, or variance-ratio distribution, with ${\nu }_{1}$ and ${\nu }_{2}$ degrees of freedom, $P\left(F\le f:{\nu }_{1},{\nu }_{2}\right)$, is defined by:
 $PF≤f:ν1,ν2=ν1ν1/2ν2ν2/2Γν1+ν2/2Γν1/2Γν2/2∫0fFν1-2/2ν1F+ν2-ν1+ν2/2dF,$
for ${\nu }_{1}$, ${\nu }_{2}>0$, $f\ge 0$.
The probability is computed by means of a transformation to a beta distribution, ${P}_{\beta }\left(B\le \beta :a,b\right)$:
 $PF≤f:ν1,ν2=PβB≤ν1fν1f+ν2:ν1/2,ν2/2$
and using a call to g01ee.
For very large values of both ${\nu }_{1}$ and ${\nu }_{2}$, greater than ${10}^{5}$, a normal approximation is used. If only one of ${\nu }_{1}$ or ${\nu }_{2}$ is greater than ${10}^{5}$ then a ${\chi }^{2}$ approximation is used, see Abramowitz and Stegun (1972).

# References

Abramowitz M and Stegun I A (1972) Handbook of Mathematical Functions (3rd Edition) Dover Publications
Hastings N A J and Peacock J B (1975) Statistical Distributions Butterworth

# Error Indicators and Warnings

Note: g01ed may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the method:
If ${\mathbf{ifail}}={1}$${2}$ or ${3}$ on exit, then g01ed returns $0.0$.
${\mathbf{ifail}}=1$
 On entry, ${\mathbf{tail}}\ne \text{"L"}$ or $\text{"U"}$.
${\mathbf{ifail}}=2$
 On entry, ${\mathbf{f}}<0.0$.
${\mathbf{ifail}}=3$
 On entry, ${\mathbf{df1}}\le 0.0$, or ${\mathbf{df2}}\le 0.0$.
${\mathbf{ifail}}=4$
f is too far out into the tails for the probability to be evaluated exactly. The result tends to approach $1.0$ if $f$ is large, or $0.0$ if $f$ is small. The result returned is a good approximation to the required solution.
${\mathbf{ifail}}=-9000$
An error occured, see message report.

# Accuracy

The result should be accurate to five significant digits.

# Parallelism and Performance

None.

For higher accuracy g01ee can be used along with the transformations given in [Description].

# Example

This example reads values from, and degrees of freedom for, a number of $F$-distributions and computes the associated lower tail probabilities.

Example program (C#): g01ede.cs

Example program data: g01ede.d

Example program results: g01ede.r