Function for generating values from chi-square distributions.


chisq(n:int) : real

where n>=1. It returns a drawing from a chi-square distribution with n degrees of freedom.

The sum of the squares of n independent normally distributed random variables with mean 0.0 and standard deviation 1.0 is a chi-squared distribution with n degrees of freedom.

It raises Chisq exception if n<1.


Mean: n
Variance: 2n

Density functions for chi-square distributions:

Density functions for chi-square distributions


An example for this distribution has been omitted because it is rarely found in nature. Instead, the distribution is used when doing statistical tests.

Related pages