JuliaRandom / JuliaRandom/RandomNumbers.jl

Testing PRNGs to help in the selection of high-quality PRNGs

オープン
#66 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Julia
スター
100
フォーク
23
PR マージ指標
30日以内にマージされた PR はありません

説明

I have written a page on [testing PRNGs for high-quality randomness](https://github.com/peteroupc/peteroupc.github.io/blob/master/randomtest.md). My goal is to use the results of statistical randomness tests to inform decisions on which PRNGs are high-quality, more specifically, by testing whether the PRNG produces a sequence of numbers that behave like independent uniform random numbers. If a PRNG does well in statistical testing (and meets [my other criteria of a high-quality PRNG](https://peteroupc.github.io/random.html#High_Quality_RNGs_Requirements)), only then should we discuss its other aspects (such as performance and ease of implementation).

The following are some points on PRNG testing:

- There are many kinds of PRNGs, including traditional, counter-based, and splittable PRNGs, as well as PRNGs that combine two or more other PRNGs, and there are different approaches to testing all these kinds.

- Many PRNGs have a cycle length so large that no (empirical) statistical test can evaluate all the numbers in the cycle in a reasonable time. At most, the test can only look at a small fraction of the PRNG's behavior (e.g., PractRand has a limit of 32 TiB, or 2^46 bytes). The most demanding simulations may require still fewer random numbers, e.g., [10^11 numbers at most](https://github.com/nest/nest-simulator/issues/1440). I currently consider a PRNG statistically good if it doesn't fail PractRand at 1 TiB (2^40 bytes) (where I don't consider "unusual" or "suspicious" results, as opposed to "FAILs", to be failures). Is this threshold too low or too high?

- Different PRNGs have different ways to produce independent random number sequences ("streams"), such as by incrementing a seed, or discarding a huge number of outputs. A given stream strategy can be tested by interleaving the outputs of those streams. I am currently testing two or four PRNGs with consecutive seeds, as well as two or four PRNGs that are "[jumped ahead](https://github.com/peteroupc/peteroupc.github.io/blob/master/jump.md)" in the manner supported by the PRNG.

- A relatively low-quality PRNG can be combined with another number sequence to produce a high-quality PRNG, enough to show no PractRand failure at 1 TiB (see "Combined PRNGs" for details). A notable example is L'Ecuyer's combined multiple recursive generators.

- Counter-based PRNGs and splittable PRNGs (such as the [PRNG used in JAX](https://github.com/google/jax/blob/master/design_notes/prng.md)) can be based on hash functions and other mixing functions, so it's useful to test these functions to see if they are viable for use in these kinds of PRNGs. (I give [some of these constructions in detail](https://github.com/peteroupc/peteroupc.github.io/blob/master/hqprng.md).) On the subject of mixing functions, a [testing procedure by P. Evensen](https://mostlymangling.blogspot.com/2019/01/better-stronger-mixer-and-test-procedure.html) may be of interest.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

Start by reading randomtest.md, random.html, jump.md, and hqprng.md, then review the linked PractRand and JAX material. The issue names no implementation file, test entry point, or bounded deliverable; its scope and completion criteria would need to be clarified before work begins.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
julia
領域
testing-qa
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
15/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。