Statistics Toolbox    
chi2pdf

Chi-square (2) probability density function (pdf)

Syntax

Description

Y = chi2pdf(X,V) computes the 2 pdf at each of the values in X using the corresponding parameters in V. Vector or matrix inputs for X and V must have the same size, which is also the size of output Y. A scalar input is expanded to a constant matrix 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 1].

The 2 pdf for a given value x and  degrees of freedom is

where ( · ) is the Gamma function. The result, y, is the probability that a single observation from a 2 distribution with  degrees of freedom will have value x.

If x is standard normal, then x2 is distributed 2 with one degree of freedom. If x1x2, ..., xn are n independent standard normal observations, then the sum of the squares of the x's is distributed 2 with n degrees of freedom (and is equivalent to the gamma density function with parameters /2 and 2).

Examples

The mean of the 2 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.

See Also

chi2cdf, chi2inv, chi2rnd, chi2stat, pdf


  chi2inv chi2rnd