Approximately computes cumulative distribution function of the test statistic of the Topological Binary Test of Alcover et al. (2013) and finds the required critical value for the test.
TBT.criticalValue(m, k, alpha = 0.01, cdf = FALSE, exact = TRUE)
the length of words (B-bit) in Topological Binary Test.
the number of words (integers) generated by the RNG of interest that will be tested.
a predetermined value of type-I error with the default value of 0.05.
if TRUE
, the cumulative distribution function of the test statistic is stored and printed.
if TRUE
, the function Stirling2
from the package gmp is used to calculate the Stirling numbers of the second kind in the case that the function Strlng2
from the package CryptRndTest returns a NaN
. Otherwise, nothing is done for NaN
's generated by Strlng2
.
a vector containing the cumulative probabilities corresponding to the values in value
.
a vector containing the values of the test statistic.
critical value of the test statistic corresponding to alpha
.
The function TBT.criticalValue
lists the cumulative probabilities greater than zero if cdf
is set to TRUE
.
A correction factor is applied to improve accuracy of the the function Strlng2
in the computation of probabilities. Accuracy of the computations decreases with increasing value of m
.
Alcover, P.M., Guillamon, A., Ruiz, M.C., A new randomness test for bit sequences. Informatica (2013), 24(3), 339--356.
# NOT RUN {
# Critical values for the Topological Binary Test at 0.01 and 0.05 levels of significance.
TBT.criticalValue(m=8, k=256, alpha=0.01, cdf=FALSE, exact=FALSE)
TBT.criticalValue(m=8, k=256, alpha=0.05, cdf=FALSE, exact=FALSE)
# }
Run the code above in your browser using DataLab