Performs random walk tests of Doganaksoy et al. (2006) to evaluate the randomness of an RNG. It runs Random Walk Excursion, Random Walk Expansion, and Random Walk Height tests.
random.walk.tests(x, B = 64, Excursion = TRUE, Expansion = TRUE,
Height = TRUE, alpha = 0.05)
a matrix that includes random data in base-2 format. See details for further information.
the length of words (B-bit). See Details section.
if TRUE
, Random Walk Excursion test is applied.
if TRUE
, Random Walk Expansion test is applied.
if TRUE
, Random Walk Height test is applied.
a predetermined value of significance level with the default value of 0.05.
value of test statistic of Anderson-Darling goodness-of-fit test conducted after application of Random Walk Excursion procedure.
value of test statistic of Kolmogorov-Smirnov goodness-of-fit test conducted after application of Random Walk Excursion procedure.
value of test statistic of Chi-Square goodness-of-fit test conducted after application of Random Walk Excursion procedure.
p-value of Anderson-Darling goodness-of-fit test conducted after application of Random Walk Excursion procedure.
p-value of Kolmogorov-Smirnov goodness-of-fit test conducted after application of Random Walk Excursion procedure.
p-value of Chi-Square goodness-of-fit test conducted after application of Random Walk Excursion procedure.
returns 0 if H0 is rejected and 1 otherwise in Anderson-Darling goodness-of-fit test conducted after application of Random Walk Excursion procedure.
returns 0 if H0 is rejected and 1 otherwise in Kolmogorov-Smirnov goodness-of-fit test conducted after application of Random Walk Excursion procedure.
returns 0 if H0 is rejected and 1 otherwise in Chi-Square goodness-of-fit test conducted after application of Random Walk Excursion procedure.
value of test statistic of Anderson-Darling goodness-of-fit test conducted after application of Random Walk Expansion procedure.
value of test statistic of Kolmogorov-Smirnov goodness-of-fit test conducted after application of Random Walk Expansion procedure.
value of test statistic of Chi-Square goodness-of-fit test conducted after application of Random Walk Expansion procedure.
p-value of Anderson-Darling goodness-of-fit test conducted after application of Random Walk Expansion procedure.
p-value of Kolmogorov-Smirnov goodness-of-fit test conducted after application of Random Walk Expansion procedure.
p-value of Chi-Square goodness-of-fit test conducted after application of Random Walk Expansion procedure.
returns 0 if H0 is rejected and 1 otherwise in Anderson-Darling goodness-of-fit test conducted after application of Random Walk Expansion procedure.
returns 0 if H0 is rejected and 1 otherwise in Kolmogorov-Smirnov goodness-of-fit test conducted after application of Random Walk Expansion procedure.
returns 0 if H0 is rejected and 1 otherwise in Chi-Square goodness-of-fit test conducted after application of Random Walk Expansion procedure.
value of test statistic of Anderson-Darling goodness-of-fit test conducted after application of Random Walk Height procedure.
value of test statistic of Kolmogorov-Smirnov goodness-of-fit test conducted after application of Random Walk Height procedure.
value of test statistic of Chi-Square goodness-of-fit test conducted after application of Random Walk Height procedure.
p-value of Anderson-Darling goodness-of-fit test conducted after application of Random Walk Height procedure.
p-value of Kolmogorov-Smirnov goodness-of-fit test conducted after application of Random Walk Height procedure.
p-value of Chi-Square goodness-of-fit test conducted after application of Random Walk Height procedure.
returns 0 if H0 is rejected and 1 otherwise in Anderson-Darling goodness-of-fit test conducted after application of Random Walk Height procedure.
returns 0 if H0 is rejected and 1 otherwise in Kolmogorov-Smirnov goodness-of-fit test conducted after application of Random Walk Height procedure.
returns 0 if H0 is rejected and 1 otherwise in Chi-Square goodness-of-fit test conducted after application of Random Walk Height procedure.
Argument x
should be entered as a matrix of bits of dimension \(B\)x\(k\), where \(k\) is the number of words (integers) generated by the RNG of interest.
If Excursion
is TRUE, B takes the values 16, 32, 64, 128, and 256. If Height
is TRUE, B takes 64, 128, 256, 512, and 1024. If Expansion
is TRUE, B takes 32, 64, and 128. Because theoretical cumulative distribution functions for the other word lengths, random.walk.tests()
performs tests under given bit settings. If one of the tests is not applied, all the results related with that test in output are set to -1.
Doganaksoy, A., Calik, C., Sulak, F., Turan, M.S., New randomness tests using random walk, In: National Cryptology Symposium II, (2006), Ankara, Turkey.
# NOT RUN {
RNGkind(kind = "Super-Duper")
B=64 # Bit length is 64.
k=500 # Generate 500 integers.
dat=round(runif(k,0,(2^B-1)))
x=sfsmisc::digitsBase(dat, base= 2, B) #Convert to base 2
alpha = 0.05
test=random.walk.tests(x, B, Excursion = TRUE, Expansion = TRUE, Height = TRUE, alpha)
print(test)
# }
Run the code above in your browser using DataLab