next up previous
Next: Runs Tests Up: Tests for Random Numbers Previous: Tests for Random Numbers

Frequency test

The Kolmogorov-Smirnov test
This test compares the cdf of uniform distribution F(x) to the empirical cdf $S_N (X)$ of the sample of N observations.

Chi-Square test
The chi-square test looks at the issue from the same angle but uses different method. Instead of measure the difference of each point between the samples and the true distribution, chi-square checks the ``deviation'' from the ``expected'' value.

\begin{displaymath}x_0^2 = \sum_{i=1}^n \frac{(O_i - E_i)^2} {E_i} \end{displaymath}

where n is the number of classes (e.g. intervals), $O_i$ is the number of samples obseved in the interval, $E_i$ is expected number of samples in the interval. If the sample size is N, in a uniform distribution,

\begin{displaymath}E_i = \frac{N} {n} \end{displaymath}

See Example 8.7 on page 302.


next up previous
Next: Runs Tests Up: Tests for Random Numbers Previous: Tests for Random Numbers
Meng Xiannong 2002-10-18