Main Content

fcdf

F cumulative distribution function

Description

p = fcdf(x,nu1,nu2) returns the F cumulative distribution function (cdf) evaluated at the values in x, using the numerator degrees of freedom nu1 and denominator degrees of freedom nu2.

example

p = fcdf(x,nu1,nu2,"upper") returns the complement of the F cdf, evaluated at the values in x, using an algorithm that more accurately computes the extreme upper-tail probabilities as compared to subtracting the lower-tail value from 1.

example

Examples

collapse all

Compute the cumulative distribution function (cdf) values evaluated at the values in x for the F distribution with 5 numerator degrees of freedom and 3 denominator degrees of freedom.

x = 0:0.01:25;
p = fcdf(x,5,3);

Plot the cdf.

plot(x,p)
grid on
xlabel("x")
ylabel("p")

Figure contains an axes object. The axes object with xlabel x, ylabel p contains an object of type line.

Determine the probability of sampling a number greater than 10000 from the F distribution with 5 numerator degrees of freedom and 10 denominator degrees of freedom. To determine the probability, calculate the probability of sampling a number less than or equal to 10000 and subtract the result from 1.

p1 = 1 - fcdf(10000,5,10)
p1 = 
0

The probability of sampling a number less than or equal to 10000 is so close to 1 that subtracting the probability from 1 gives 0.

To approximate the extreme upper-tail probability with greater precision, compute the complement of the F cdf directly.

p2 = fcdf(10000,5,10,"upper")
p2 = 
3.7491e-18

The output indicates a small probability of sampling a number greater than 10000.

Input Arguments

collapse all

Values at which to evaluate the F cdf, specified as a nonnegative scalar or an array of nonnegative scalars.

To evaluate the cdf at multiple values, specify x as an array. To evaluate the cdfs of multiple distributions, specify either nu1 or nu2 (or both) using arrays. If one or more of the input arguments x, nu1, and nu2 are arrays, then the array sizes must be the same. In this case, fcdf expands each scalar input into a constant array of the same size as the array inputs. Each element in p is the cdf value of the distribution specified by the corresponding elements in nu1 and nu2, evaluated at the corresponding element in x.

Data Types: single | double

Numerator degrees of freedom, specified as a positive scalar or an array of positive scalars.

To evaluate the cdf at multiple values, specify x as an array. To evaluate the cdfs of multiple distributions, specify either nu1 or nu2 (or both) using arrays. If one or more of the input arguments x, nu1, and nu2 are arrays, then the array sizes must be the same. In this case, fcdf expands each scalar input into a constant array of the same size as the array inputs. Each element in p is the cdf value of the distribution specified by the corresponding elements in nu1 and nu2, evaluated at the corresponding element in x.

Data Types: single | double

Denominator degrees of freedom, specified as a positive scalar or an array of positive scalars.

To evaluate the cdf at multiple values, specify x as an array. To evaluate the cdfs of multiple distributions, specify either nu1 or nu2 (or both) using arrays. If one or more of the input arguments x, nu1, and nu2 are arrays, then the array sizes must be the same. In this case, fcdf expands each scalar input into a constant array of the same size as the array inputs. Each element in p is the cdf value of the distribution specified by the corresponding elements in nu1 and nu2, evaluated at the corresponding element in x.

Data Types: single | double

Output Arguments

collapse all

F cdf values evaluated at the values in x, returned as a numeric scalar or array. p is the same size as x, nu1, and nu2 after any necessary scalar expansion. Each element in p is the cdf value of the distribution specified by the corresponding elements in nu1 and nu2, evaluated at the corresponding element in x.

More About

collapse all

Alternative Functionality

  • fcdf is a function specific to the F distribution. Statistics and Machine Learning Toolbox™ also offers the generic function cdf, which supports various probability distributions. To use cdf, specify the probability distribution name and its parameters. Note that the distribution-specific function fcdf is faster than the generic function cdf.

  • Use the Probability Distribution Function Tool to create an interactive plot of the cumulative distribution function (cdf) or probability density function (pdf) for a probability distribution.

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Version History

Introduced before R2006a

See Also

| | | |