Previous Up Next

9.4.9  The χ2 distribution

The probability density function for the χ2 distribution: chisquare

The χ2 distribution with n degrees of freedom has density function given by

χ2(n,x) = 
xn/2−1ex/2
2n/2Γ(n/2)
    (6)

The chisquare command computes this density function.


Example.
Input:

chisquare(5,2)

Output:

2
e 


3
4
 
π 
 
2
· 22


which can be numerically approximated by:
Input:

evalf(chisquare(5,2))

Output:

0.138369165807

The cumulative distribution function for the χ2 distribution: chisquare_cdf

The chisquare_cdf command computes the cumulative distribution function for the χ2 distribution.


Examples.

The inverse distribution function for the χ2 distribution: chisquare_icdf

The chisquare_icdf command computes the inverse distribution for the χ2 distribution.


Example.
Input:

chisquare_icdf(5,0.95)

Output:

11.0704976935

The upper tail cumulative function for the χ2 distribution: UTPC

The UTPC (the Upper Tail Probability - Chi-square distribution) computes Prob(X > x) for the χ2 distribution.


Example.
Input:

UTPC(5,11)

Output:

0.0513799834831

Previous Up Next