freq.test(u, seq = 0:15, echo = TRUE)
TRUE
0:15
.statistic
the value of the chi-squared statistic.
p.value
the p-value of the test.
observed
the observed counts.
expected
the expected counts under the null hypothesis.
residuals
the Pearson residuals, (observed - expected) / sqrt(expected).
u
, realisation of i.i.d. uniform random
variables $U_1, \dots, U_n$.
The frequency test works on a serie seq
of ordered contiguous integers
($s_1,\dots,s_d$), where $s_j\in Z\!\!Z$. From the
sample u
, we compute observed integers as
L'Ecuyer P. (2001), Software for uniform random number generation distinguishing the good and the bad. Proceedings of the 2001 Winter Simulation Conference. (available online)
L'Ecuyer P. (2007), Test U01: a C library for empirical testing of random number generators. ACM Trans. on Mathematical Software 33(4), 22.
gap.test
, serial.test
, poker.test
,
order.test
and coll.test
ks.test
for the Kolmogorov Smirnov test and acf
for
the autocorrelation function.
# (1)
#
freq.test(runif(1000))
print( freq.test( runif(1000000), echo=FALSE) )
# (2)
#
freq.test(runif(1000), 1:4)
freq.test(runif(1000), 10:40)
Run the code above in your browser using DataLab