Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > pl.comp.programming > #29056

Re: testowanie generatorów liczb losowych (kontynuacja)

From bartekltg <bartekltg@gmail.com>
Newsgroups pl.comp.programming
Subject Re: testowanie generatorów liczb losowych (kontynuacja)
Date 2016-10-07 02:58 +0200
Organization ATMAN - ATM S.A.
Message-ID <nt6rvk$78f$1@node2.news.atman.pl> (permalink)
References <7e48f2e8-4a53-430a-b2fb-6213375c0cc3@googlegroups.com>

Show all headers | View raw


On 06.10.2016 22:42, M.M. wrote:
> Trudno uwierzyć, ale widać czarno na białym, że mt19937_1998
> wg diehardera nie przechodzi testu birthdays. dieharder ma
> problem, MT, ja coś źle robię?
>
>
>
> time dieharder -d 0 -g 15 -m 1000
> #=============================================================================#
> #            dieharder version 3.31.1 Copyright 2003 Robert G. Brown          #
> #=============================================================================#
>    rng_name    |rands/second|   Seed   |
>    mt19937_1998|  1.12e+07  | 502159522|
> #=============================================================================#
>         test_name   |ntup| tsamples |psamples|  p-value |Assessment
> #=============================================================================#
>    diehard_birthdays|   0|       100|  100000|0.00000458|   WEAK
>
> real    31m42.178s
> user    31m31.855s
> sys     0m6.840s
>
>
>
> time dieharder -d 0 -g 15 -m 5000
> #=============================================================================#
> #            dieharder version 3.31.1 Copyright 2003 Robert G. Brown          #
> #=============================================================================#
>    rng_name    |rands/second|   Seed   |
>    mt19937_1998|  4.32e+06  |2158334279|
> #=============================================================================#
>         test_name   |ntup| tsamples |psamples|  p-value |Assessment
> #=============================================================================#
>    diehard_birthdays|   0|       100|  100000|0.00000000|  FAILED
>
> real    39m10.705s
> user    39m3.746s
> sys     0m4.479s
>

Jedna sptawa, to ta flaga:

   -k ks_flag - ks_flag

      0 is fast but slightly sloppy for psamples > 4999 (default).
//A Ty yżywasz p=100 000
...

      2 is very slow and accurate to machine precision.
...


Druga opcja, którą mozęsz się zainteresować to testowanie do upadłego,
zwłąszczą uwagami. To nie musi być problem generatora, ale może być i 
testu, bo niekoniecznie są one numerycznie stabilne z wystarczającą
dokłądnośćią, a nieraz i ich teoretyczny rozkład jest dla wersji
asymptotycznej (hmm, w sumie wtedy może zwiększenie -t ).


   -Y Xtrategy - the Xtrategy flag controls the new 'test to failure' (T2F)
      modes.  These flags and their modes act as follows:
...
      2 - 'test to destruction' (T2D) mode.  Sometimes you just want to know
      where or if a generator will .I ever fail a test (or test series). 
  -Y 2
      causes psamples to be added 100 at a time until a test returns an
      overall pvalue lower than the failure threshold or a specified maximum
      number of psamples (see -P) is reached.

      Note well!  In this mode one may well fail due to the alternate
      null hypothesis -- the test itself is a bad test and fails!  Many
      dieharder tests, despite our best efforts, are numerically unstable or
      have only approximately known target statistics or are straight up
      asymptotic results, and will eventually return a failing result 
even for
      a gold-standard generator (such as AES), or for the hypercautious the
      XOR generator with AES, threefish, kiss, all loaded at once and xor'd
      together.  It is therefore safest to use this mode comparatively,
      executing a T2D run on AES to get an idea of the test failure
      threshold(s) (something I will eventually do and publish on the web so
      everybody doesn't have to do it independently) and then running it on
      your target generator.  Failure with numbers of psamples within an 
order
      of magnitude of the AES thresholds should probably be considered
      possible test failures, not generator failures.  Failures at levels
      significantly less than the known gold standard generator failure
      thresholds are, of course, probably failures of the generator.

      This option should only be used with -k 2.


MT nie jest też generatorem idealnym.


W dokumentacji, chyba nie ma online, jest w paczce w
.../dieharder-3.31.1/manual/ jako TeX (trzeba skompilować)
Jest tam rozdział o bracei tego generatora
7.0.1 A Good Generator: mt19937 1999
I po nastu stronach wyników jest omówienie. Czego nie przechodzi,
co przechodzi. I ejst tam też to:

We then begin on the Diehard tests. The test passes the birthday test, 
but examining
the distribution produced we can see that the pass is a bit “marginal”, 
in the sense that
p isn’t terribly uniformly distributed. When this happens, one may want 
to rerun the
particular test a few times to see if the features in the histogram vary 
or are systematic.
Alternatively, rerunning it with a larger value of KS samples with e.g. 
-p 1000 or more
may push it into unambiguous failure and in fact it does. This is a 
marginal result,
and a sample of random numbers far smaller than what would be used in 
any numerical
simulation will unambiguously fail the Diehard birthdays test.


Zawalenie _już_ przy -p 1000 jest przewidywane (choć ten tekst jak i
cała ksiazeczka jest niewiele zmieniana od wielu wersji, może coś
poprawili w kodzie).
O co chodzi w ostatneim, wydaje się najważniejszym, zdaniu,
nie mam pojęćia.

Dokręciły się testy:
time dieharder -d 0 -g 15 -m 1000
#=============================================================================#
#            dieharder version 3.31.1 Copyright 2003 Robert G. Brown 
      #
#=============================================================================#
    rng_name    |rands/second|   Seed   |
    mt19937_1998|  1.68e+07  |2613656395|
#=============================================================================#
         test_name   |ntup| tsamples |psamples|  p-value |Assessment
#=============================================================================#
    diehard_birthdays|   0|       100|  100000|0.00006613|   WEAK

real	22m53.588s
user	22m48.928s
sys	0m0.884s

time dieharder -d 0 -g 15 -m 1000 -k 2
#=============================================================================#
#            dieharder version 3.31.1 Copyright 2003 Robert G. Brown 
      #
#=============================================================================#
    rng_name    |rands/second|   Seed   |
    mt19937_1998|  1.71e+07  |3645920823|
#=============================================================================#
         test_name   |ntup| tsamples |psamples|  p-value |Assessment
#=============================================================================#
    diehard_birthdays|   0|       100|  100000|0.00000002|  FAILED

real	39m30.472s
user	39m14.048s
sys	0m5.244s

time dieharder -d 0 -g 15 -m 5000 -k 2
#=============================================================================#
#            dieharder version 3.31.1 Copyright 2003 Robert G. Brown 
      #
#=============================================================================#
    rng_name    |rands/second|   Seed   |
    mt19937_1998|  6.62e+06  |2144839991|
#=============================================================================#
         test_name   |ntup| tsamples |psamples|  p-value |Assessment
#=============================================================================#
    diehard_birthdays|   0|       100|  100000|0.00000012|  FAILED

real	42m33.697s
user	42m25.048s
sys	0m4.516s


Za poradą z pdfa, ten sam test, twardszy generator,
chyba jednak to już wina testu/implementacji

time dieharder -d 0 -g 205 -m 1000 -k 2
#=============================================================================#
#            dieharder version 3.31.1 Copyright 2003 Robert G. Brown 
      #
#=============================================================================#
    rng_name    |rands/second|   Seed   |
         AES_OFB|  5.17e+06  |3983713961|
#=============================================================================#
         test_name   |ntup| tsamples |psamples|  p-value |Assessment
#=============================================================================#
    diehard_birthdays|   0|       100|  100000|0.00003436|   WEAK

real	34m53.133s
user	34m47.464s
sys	0m4.556s



time dieharder -d 0 -g 205 -m 5000 -k 2
#=============================================================================#
#            dieharder version 3.31.1 Copyright 2003 Robert G. Brown 
      #
#=============================================================================#
    rng_name    |rands/second|   Seed   |
         AES_OFB|  1.98e+06  | 373043125|
#=============================================================================#
         test_name   |ntup| tsamples |psamples|  p-value |Assessment
#=============================================================================#
    diehard_birthdays|   0|       100|  100000|0.00000176|   WEAK

real	56m56.810s
user	56m31.972s
sys	0m22.432s

pzdr
bartekltg


Back to pl.comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

testowanie  generatorów liczb losowych (kontynuacja) "M.M." <mmarszik@gmail.com> - 2016-10-06 13:42 -0700
  Re: testowanie generatorów liczb losowych (kontynuacja) Borneq <borneq@antyspam.hidden.pl> - 2016-10-07 02:00 +0200
    Re: testowanie generatorów liczb losowych (kontynuacja) "M.M." <mmarszik@gmail.com> - 2016-10-06 17:12 -0700
      Re: testowanie generatorów liczb losowych (kontynuacja) Borneq <borneq@antyspam.hidden.pl> - 2016-10-07 02:23 +0200
        Re: testowanie generatorów liczb losowych (kontynuacja) "M.M." <mmarszik@gmail.com> - 2016-10-06 17:29 -0700
          Re: testowanie generatorów liczb losowych (kontynuacja) Borneq <borneq@antyspam.hidden.pl> - 2016-10-07 15:00 +0200
            Re: testowanie generatorów liczb losowych (kontynuacja) "M.M." <mmarszik@gmail.com> - 2016-10-07 06:20 -0700
              Re: testowanie generatorów liczb losowych (kontynuacja) bartekltg <bartekltg@gmail.com> - 2016-10-07 07:39 -0700
                Re: testowanie generatorów liczb losowych (kontynuacja) "M.M." <mmarszik@gmail.com> - 2016-10-07 07:51 -0700
                Re: testowanie generatorów liczb losowych (kontynuacja) bartekltg <bartekltg@gmail.com> - 2016-10-07 08:00 -0700
                Re: testowanie generatorów liczb losowych (kontynuacja) "M.M." <mmarszik@gmail.com> - 2016-10-07 08:21 -0700
                Re: testowanie generatorów liczb losowych (kontynuacja) bartekltg <bartekltg@gmail.com> - 2016-10-07 09:02 -0700
                Re: testowanie generatorów liczb losowych (kontynuacja) "M.M." <mmarszik@gmail.com> - 2016-10-07 10:40 -0700
                Re: testowanie generatorów liczb losowych (kontynuacja) bartekltg <bartekltg@gmail.com> - 2016-10-07 19:58 +0200
                Re: testowanie generatorów liczb losowych (kontynuacja) "M.M." <mmarszik@gmail.com> - 2016-10-07 15:25 -0700
                Re: testowanie generatorów liczb losowych (kontynuacja) "M.M." <mmarszik@gmail.com> - 2016-10-07 17:32 -0700
                Re: testowanie generatorów liczb losowych (kontynuacja) bartekltg <bartekltg@gmail.com> - 2016-10-08 09:52 +0200
                Re: testowanie generatorów liczb losowych (kontynuacja) "M.M." <mmarszik@gmail.com> - 2016-10-08 05:00 -0700
              Re: testowanie generatorów liczb losowych (kontynuacja) bartekltg <bartekltg@gmail.com> - 2016-10-07 07:47 -0700
                Re: testowanie generatorów liczb losowych (kontynuacja) bartekltg <bartekltg@gmail.com> - 2016-10-07 08:20 -0700
              Re: testowanie generatorów liczb losowych (kontynuacja) Borneq <borneq@antyspam.hidden.pl> - 2016-10-07 17:23 +0200
  Re: testowanie generatorów liczb losowych (kontynuacja) bartekltg <bartekltg@gmail.com> - 2016-10-07 02:58 +0200
    Re: testowanie generatorów liczb losowych (kontynuacja) "M.M." <mmarszik@gmail.com> - 2016-10-06 18:18 -0700

csiph-web