Main Content

ncfpdf

Noncentral F probability density function

Description

p = ncfpdf(x,nu1,nu2,delta) returns the noncentral F probability density function (pdf) with nu1 numerator degrees of freedom, nu2 denominator degrees of freedom, and the noncentrality parameter delta, evaluated at the values in x.

example

Examples

collapse all

Compute the probability density function (pdf) of a noncentral F distribution with the numerator degrees of freedom nu1=5, denominator degrees of freedom nu2=20, and noncentrality parameter delta=10. For comparison, also compute the pdf of an F distribution with the same degrees of freedom.

x = 0.01:0.1:10.01;
nu1 = 5;
nu2 = 20;
delta = 10;
ncf = ncfpdf(x,nu1,nu2,delta);
f = fpdf(x,nu1,nu2);

Plot the noncentral F pdf and the F pdf on the same figure.

figure
plot(x,ncf,"b-",LineWidth=2)
hold on
grid on
plot(x,f,"r--",Linewidth=2)
xlabel("x")
ylabel("p")
legend("Noncentral F pdf","F pdf")
hold off

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

Input Arguments

collapse all

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

To evaluate the pdf at multiple values, specify x using an array. To evaluate the pdfs 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, ncfpdf expands each scalar input into a constant array of the same size as the array inputs. Each element in p is the pdf 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 pdf at multiple values, specify x using an array. To evaluate the pdfs 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, ncfpdf expands each scalar input into a constant array of the same size as the array inputs. Each element in p is the pdf 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 pdf at multiple values, specify x using an array. To evaluate the pdfs 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, ncfpdf expands each scalar input into a constant array of the same size as the array inputs. Each element in p is the pdf 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. When delta=0, the noncentral F distribution is equivalent to the F distribution.

To evaluate the pdf at multiple values, specify x using an array. To evaluate the pdfs 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, ncfpdf expands each scalar input into a constant array of the same size as the array inputs. Each element in p is the pdf 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 pdf 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 pdf value of the distribution specified by the corresponding elements in nu1, nu2, and delta, evaluated at the corresponding element in x.

Alternative Functionality

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

  • 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