Main Content

fpdf

F probability density function

Description

p = fpdf(x,nu1,nu2) returns the probability density function (pdf) of the F distribution with the numerator degrees of freedom nu1 and denominator degrees of freedom nu2, evaluated at the values in x.

example

Examples

collapse all

Compute the probability density function (pdf) of the F distribution with 3 numerator degrees of freedom and 5 denominator degrees of freedom, over the range [0,5].

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

Plot the pdf.

figure;
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.

Input Arguments

collapse all

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

To evaluate the pdf at multiple values, specify x as an array. To evaluate the pdfs 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, fpdf 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 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 pdf at multiple values, specify x as an array. To evaluate the pdfs 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, fpdf 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 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 pdf at multiple values, specify x as an array. To evaluate the pdfs 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, fpdf 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 and nu2, evaluated at the corresponding element in x.

Data Types: single | double

Output Arguments

collapse all

F pdf values, 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 pdf 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

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

Extended Capabilities

expand all

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

Version History

Introduced before R2006a

See Also

| | | |