mercredi 18 janvier 2017

runif fails testu01's SmallCrush

I am seeing a failure of the R random number generator using testu01 SmallCrush. This surprises me as the documentation says runif uses Mersenne Twister. I wonder what I am doing wrong.

I run

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

and then SmallCrush via

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

and get a failure:

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




Aucun commentaire:

Enregistrer un commentaire