forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Lib rand
huonw edited this page Apr 28, 2013
·
31 revisions
Generating random numbers, and sampling from random distributions.
- Proposed editor: your name
- Date proposed: date of proposal
- Link: link to email
- Standard: standard - link to docs - ...
- Standard: standard - link to docs - ...
- Technique: ISAAC/ISAAC-64 RNG - http://burtleburtle.net/bob/rand/isaacafa.html - ISAAC is the main RNG used in rust at the moment
- Technique: Testing quality of random numbers - Very important! Extremely hard to tell if random numbers are "random enough" (a bug in an implementation, or a bad algorithm, can produce numbers that look random but aren't random enough for many purposes). - Overview wikipedia article - Diehard tests (e.g. dieharder) - TestU01 including "Small crush", "Crush" and "Big crush" - tests written by the creator of ISAAC - Add a new make target "check-rngs" with a testsuite?
- Technique: sampling from distributions - Inverse transform sampling (fully general) - Ziggurat algorithm (distributions with decreasing density functions) - Box-Muller transform and Marsaglia polar method (normal distribution, both are almost certainly inferior to the ziggurat algorithm)
- Language: C++ - http://www.cplusplus.com/reference/random/
- Language: Python - http://docs.python.org/3.3/library/random.html
- Language: R (statistical language, so much broader random number support than necessary) - http://stat.ethz.ch/R-manual/R-patched/library/base/html/Random.html - http://stat.ethz.ch/R-manual/R-patched/library/stats/html/Distributions.html
- Pull request: link to bug
- note
- note
- note