# fcdf

F cumulative distribution function

## Syntax

p = fcdf(x,v1,v2)
p = fcdf(x,v1,v2,'upper')

## Description

p = fcdf(x,v1,v2) computes the F cdf at each of the values in x using the corresponding numerator degrees of freedom v1 and denominator degrees of freedom v2. x, v1, and v2 can be vectors, matrices, or multidimensional arrays that are all the same size. A scalar input is expanded to a constant matrix with the same dimensions as the other inputs. v1 and v2 parameters must contain real positive values, and the values in x must lie on the interval [0 Inf].

p = fcdf(x,v1,v2,'upper') returns the complement of the F cdf at each value in x, using an algorithm that more accurately computes the extreme upper tail probabilities.

The F cdf is

$p=F\left(x|{\nu }_{1},{\nu }_{2}\right)={\int }_{0}^{x}\frac{\Gamma \left[\frac{\left({\nu }_{1}+{\nu }_{2}\right)}{2}\right]}{\Gamma \left(\frac{{\nu }_{1}}{2}\right)\Gamma \left(\frac{{\nu }_{2}}{2}\right)}{\left(\frac{{\nu }_{1}}{{\nu }_{2}}\right)}^{\frac{{\nu }_{1}}{2}}\frac{{t}^{\frac{{\nu }_{1}-2}{2}}}{{\left[1+\left(\frac{{\nu }_{1}}{{\nu }_{2}}\right)t\right]}^{\frac{{\nu }_{1}+{\nu }_{2}}{2}}}dt$

The result, p, is the probability that a single observation from an F distribution with parameters ν1 and ν2 will fall in the interval [0 x].

## Examples

collapse all

The following illustrates a useful mathematical identity for the F distribution.

nu1 = 1:5;
nu2 = 6:10;
x = 2:6;

F1 = fcdf(x,nu1,nu2)
F1 = 1×5

0.7930    0.8854    0.9481    0.9788    0.9919

F2 = 1 - fcdf(1./x,nu2,nu1)
F2 = 1×5

0.7930    0.8854    0.9481    0.9788    0.9919