X = [0.01, 0.36, 0.97, 0.44, 0.86, 0.49, 0.02, 0.19, 0.54, 0.63, 0.69, 0.27, 0.21, 0.55, 0.54, 0.1 , 0.02, 0.49 , 0.42, 0.79], is a list of 20 random numbers generated from a pseudo-random number generator G.
a. What is a uniformity test?
b. Using Chi-square Goodness-of-fit test with 4 bins, test whether X belongs to U(0, 1) based on 5% significant level.
c. Can we conclude G generates truly random numbers following the distribution U(0, 1)?
a.
squared test for uniformity can be formulated by binning the ranks 0: M into J bins and testing that the bins all have roughly the expected number of draws in them.
If bj is the number of ranks that fall into bin j and ej is the number of ranks expected to fall into
bin j, the test statistic is
b.
X belongs to U(0, 1)
X does not belong to U(0, 1)
4 bins:
expected number of values in each interval is
then:
critical value:
c.
Since we accept the null hypothesis. X belongs to U(0, 1)
Comments