runif使testu01的SmallCrush失败了

时间:2017-01-18 07:45:00

标签: r random mersenne-twister

我看到使用testu01 SmallCrush的R随机数生成器出现故障。这让我感到惊讶,因为文档说runif使用Mersenne Twister。我不知道我做错了什么。

我跑

set.seed(42)
rs <- runif(n=51320000)
write(x=rs,file="foo.bar")

然后SmallCrush通过

#include "bbattery.h"
int main(int argc, char *argv[])
{
  bbattery_SmallCrushFile("foo.bar");
}

并失败:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                 Starting SmallCrush
                 Version: TestU01 1.2.3
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


***********************************************************
HOST = Hogsmill.local, Darwin

ufile_CreateReadText:   foo.bar


smarsa_BirthdaySpacings test:
-----------------------------------------------
   N =  1,  n = 5000000,  r =  0,    d = 1073741824,    t = 2,    p = 1


      Number of cells = d^t = 1152921504606846976
      Lambda = Poisson mean =      27.1051


----------------------------------------------------
Total expected number = N*Lambda      :      27.11
Total observed number                 :   67744
p-value of test                       :   eps      *****


-----------------------------------------------
CPU time used                    :  00:00:03.04

Generator state:
 10000000  numbers have been read

0 个答案:

没有答案