Note: This page has been translated by MathWorks. Please click here

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Chi-square probability density function

`Y = chi2pdf(X,V)`

`Y = chi2pdf(X,V)`

computes
the chi-square pdf at each of the values in `X`

using
the corresponding degrees of freedom in `V`

. `X`

and `V`

can
be vectors, matrices, or multidimensional arrays that have the same
size, which is also the size of the output `Y`

. A
scalar input is expanded to a constant array with the same dimensions
as the other input.

The degrees of freedom parameters in `V`

must
be positive integers, and the values in `X`

must
lie on the interval `[0 Inf]`

.

The chi-square pdf for a given value *x* and *ν* degrees
of freedom is

$$y=f(x|\nu )=\frac{{x}^{(\nu -2)/2}{e}^{-x/2}}{{2}^{\nu /2}\Gamma (\nu /2)}$$

where Γ( · ) is the Gamma function.

If *x* is standard normal, then *x*^{2} is
distributed chi-square with one degree of freedom. If *x*_{1}, *x*_{2},
..., *x*_{n} are *n* independent
standard normal observations, then the sum of the squares of the *x*'s
is distributed chi-square with *n* degrees of freedom
(and is equivalent to the gamma density function with parameters *ν*/2
and 2).

nu = 1:6; x = nu; y = chi2pdf(x,nu) y = 0.2420 0.1839 0.1542 0.1353 0.1220 0.1120

The mean of the chi-square distribution is the value of the
degrees of freedom parameter, `nu`

. The above example
shows that the probability density of the mean falls as `nu`

increases.

Was this topic helpful?