The test verifies that the sample distribution function agrees with the hypothesized distribution. A chi-squared
Vstatistic with the number of degrees of freedom that is minus one from the number of the intervals of partition is considered a stable response.
First Level Test
For a given parameter set and a given sample size, the test computes the partition of the distribution domain into disjoint intervals, so that the a priori quantity of random numbers from each interval is of order 100.
The test computes the actual number of random values within each interval of the generated sample and then calculates chi-square of the statistic
V. The statistic
Vis asymptotically of chi-squared distribution
k- 1 degrees of freedom, where
kis the number of the intervals. Thus, the p-value equal to
(V)should be of a distribution that is close to uniform.
Second Level Test
The first level test is run ten times, each run producing a p-value
j= 1, 2, ... , 10. The Kolmogorov-Smirnov goodness-of-fit test with Anderson-Darling’s statistics is applied to the obtained p-values
j= 1, 2, ... , 10. If the resulting p-value
Interpreting Final Results
The final result of the test is the percentage FAIL of failed second level tests. The second level test is run ten times. The value of FAIL < 50% is considered acceptable.