eGospodarka.pl
eGospodarka.pl poleca

eGospodarka.plGrupypl.comp.programmingtestowanie generatorów liczb losowych (kontynuacja) › Re: testowanie generatorów liczb losowych (kontynuacja)
  • Path: news-archive.icm.edu.pl!agh.edu.pl!news.agh.edu.pl!newsfeed2.atman.pl!newsfeed.
    atman.pl!.POSTED!not-for-mail
    From: bartekltg <b...@g...com>
    Newsgroups: pl.comp.programming
    Subject: Re: testowanie generatorów liczb losowych (kontynuacja)
    Date: Fri, 7 Oct 2016 02:58:28 +0200
    Organization: ATMAN - ATM S.A.
    Lines: 216
    Message-ID: <nt6rvk$78f$1@node2.news.atman.pl>
    References: <7...@g...com>
    NNTP-Posting-Host: 89-70-119-159.dynamic.chello.pl
    Mime-Version: 1.0
    Content-Type: text/plain; charset=utf-8; format=flowed
    Content-Transfer-Encoding: 8bit
    X-Trace: node2.news.atman.pl 1475801908 7439 89.70.119.159 (7 Oct 2016 00:58:28 GMT)
    X-Complaints-To: u...@a...pl
    NNTP-Posting-Date: Fri, 7 Oct 2016 00:58:28 +0000 (UTC)
    User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
    Thunderbird/45.3.0
    In-Reply-To: <7...@g...com>
    Xref: news-archive.icm.edu.pl pl.comp.programming:209883
    [ ukryj nagłówki ]

    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



Podziel się

Poleć ten post znajomemu poleć

Wydrukuj ten post drukuj


Następne wpisy z tego wątku

Najnowsze wątki z tej grupy


Najnowsze wątki

Szukaj w grupach

Eksperci egospodarka.pl

1 1 1

Wpisz nazwę miasta, dla którego chcesz znaleźć jednostkę ZUS.

Wzory dokumentów

Bezpłatne wzory dokumentów i formularzy.
Wyszukaj i pobierz za darmo: