Contenuto principale

ncfcdf

Noncentral F cumulative distribution function

Description

p = ncfcdf(x,nu1,nu2,delta) returns the cumulative distribution function (cdf) of the noncentral F distribution with nu1 numerator degrees of freedom, nu2 denominator degrees of freedom, and the noncentrality parameter delta, evaluated at the values in x.

example

p = ncfcdf(x,nu1,nu2,delta,"upper") returns the complement of the noncentral 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.

Examples

collapse all

Compute the noncentral F cumulative distribution function (cdf) with the noncentrality parameter δ = 10, the numerator degrees of freedom nu1=5, and the denominator degrees of freedom nu2=20. Also compute the F cdf with the same numerator and denominator degrees of freedom by using the fcdf function.

x = (0.01:0.1:15);
nu1 = 5;
nu2 = 20;
delta = 10;
p1 = ncfcdf(x,nu1,nu2,delta);
p2 = fcdf(x,nu1,nu2);

Plot the two cdfs.

figure
plot(x,p1,"-",x,p2,"-")
grid on
xlabel("x")
ylabel("p")
legend("Noncentral F cdf","F cdf")

Figure contains an axes object. The axes object with xlabel x, ylabel p contains 2 objects of type line. These objects represent Noncentral F cdf, F cdf.

Input Arguments

collapse all

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

To evaluate the cdf at multiple values, specify x using an array. To evaluate the cdfs of multiple distributions, specify one or more of the following input arguments using arrays: nu1, nu2, or delta. If one or more of the input arguments x, nu1, nu2, and delta are arrays, then the array sizes must be the same. In this case, ncfcdf 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, nu2, and delta, 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 using an array. To evaluate the cdfs of multiple distributions, specify one or more of the following input arguments using arrays: nu1, nu2, or delta. If one or more of the input arguments x, nu1, nu2, and delta are arrays, then the array sizes must be the same. In this case, ncfcdf 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, nu2, and delta, 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 using an array. To evaluate the cdfs of multiple distributions, specify one or more of the following input arguments using arrays: nu1, nu2, or delta. If one or more of the input arguments x, nu1, nu2, and delta are arrays, then the array sizes must be the same. In this case, ncfcdf 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, nu2, and delta, evaluated at the corresponding element in x.

Data Types: single | double

Noncentrality parameter, specified as a nonnegative scalar or an array of nonnegative scalars.

To evaluate the cdf at multiple values, specify x using an array. To evaluate the cdfs of multiple distributions, specify one or more of the following input arguments using arrays: nu1, nu2, or delta. If one or more of the input arguments x, nu1, nu2, and delta are arrays, then the array sizes must be the same. In this case, ncfcdf 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, nu2, and delta, evaluated at the corresponding element in x.

Data Types: single | double

Output Arguments

collapse all

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

More About

collapse all

Alternative Functionality

  • ncfcdf is a function specific to the noncentral 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 ncfcdf 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.

References

[1] Johnson, N., and S. Kotz. Distributions in Statistics: Continuous Univariate Distributions-2. Hoboken, NJ: John Wiley & Sons, Inc., 1970.

Extended Capabilities

expand all

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

Version History

Introduced before R2006a