twochi is a program that allows you to create two histograms, based on two different randomizing generators. The resulting histograms are each analyzed for the chi-square test. The program displays the chi-square test result for each random number generator.
Two chi-square calculations are made.
The purpose of this program is to show that the random number generator in datagen compares favorably to one of the best pseudo-random number generators in existence.
twochi has the following parameters:
Examples of how to run the program.
twochi 10000 17
In this example, the program makes 10 thousand observations for success with 16 degrees of freedom.
The calculation for the chi-square test is described in the following book:
Lincoln L. Chao
Statistics for Management
2nd Edition
Palo Alto: The Scientific Press, 1984
Chapter 12, Chi-square Tests
Lincoln L. Chao published his book while at California State University, Long Beach.
The ran2 random number generator is taken from:
Numerical Recipes in C
Chapter 7.1