Previous Up Next

20.4.9  χ2 distribution

The probability density function for the χ2 distribution.

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

chisquare(5,2)
     
2
e 


3
4
 
π 
 
2
· 22


          

which can be numerically approximated by:

evalf(chisquare(5,2))
     
0.138369165807           
The cumulative distribution function for the χ2 distribution.

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

Examples

chisquare_cdf(5,11)
     
0.948620016517           
chisquare_cdf(3,1,2)
     
0.22884525243           
The inverse distribution function for the χ2 distribution.

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

Example

chisquare_icdf(5,0.95)
     
11.0704976935           
The upper tail cumulative function for the χ2 distribution.

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

Example

UTPC(5,11)
     
0.0513799834831           

Previous Up Next