|
Random Number Generators (RNGs)Web Sites for Random Number GeneratorsRANDLIB (C and Fortran versions) provides 32 virtual random number generators. Each generator can provide 1,048,576 blocks of numbers, and each block is of length 1,073,741,824. Any generator can be set to the beginning or end of the current block or to its starting value. Packaging is provided so that if these capabilities are not needed, there is a single generator with period 2.3 X 10^18. Using this base, routines are provided that return: pLab is an excellent web site created by the Department of Mathematics at the Salzburg University. It covers RNGs and tests for randomness, and contains publications, software, and pointers to other resources. Additional services may be available from pLab -- see: pLab Overview See also the Diehard page, described at: Tests for Randomness Another web page with info on RNGs is Skip Carter's page at Taygeta Also see Pierre L'Ecuyer's papers: Info on 1/f noise, called "flicker noise" or "pink noise", is at Wentian Li's site. Some code in Fortran 90 for generating random numbers from a range of discrete and continuous distributions is at Alan Miller's page.
SPRNG
is a scalable
parallel random number generator library. (It can be used for the usual
serial random number generation too.)
There are four common types of basic generators. Linear Congruential Generators (LCG)Linear congruential generators are of the form
A good discussion of this type is in the text by Press et al.
These are by far the most common form in use, and have periods
in the range 10^6 to 10^9 when using 32 bit words. Unfortunately,
they have some unpleasant properties. When taken in pairs,
triplets, or n-tuples, the random values often fall on only
a few planes in n-space. Using a shuffle box can
break up this uniformity. For more information on the
problems associated with linear congruential generators,
see Marsaglia 1968, Marsaglia 1993 and Sullivan 1993.
See also Marsaglia's web site, described under
Tests for Randomness .
Subtract-with-borrow generators have the form:
See Marsaglia 1991.
These generators have much longer periods, from 10^200 to 10^500,
than LCGs, and they are almost as fast as LCGs.
Unfortunately they too have the problem of falling
mainly on the planes. See Tezuka 1993.
Again, a shuffle box, as described in Press et al, can eliminate
this problem.
The implementation by Marsaglia and Zaman may be found at:
Marsaglia's generators.
[George Marsaglia]: Here is a simple version, one so simple and good I predict it will be the system generator for many future computers:
With multiplier 'a' chosen from a large set of easily found
integers, the period is a*2^31-1, around 2^60, and
I have yet to find a test it will not pass!
where:
ICGs do not have the "mainly in the planes" problem. See the pLab, described above at Web Sites for Random Number Generators , for more info on ICGs.
[Charles Knechtel]:
Marsaglia's Diehard suite of RNG tests, at
Tests for Randomness
also contains a subroutine named
makeinvc which implements an ICG and generates a file of pseudorandom
numbers named INVCONG.32; however, examination of the FORTRAN source code
for makeinvc shows that a modulus M equal to 2^32 was used (see file
makewhat.f. Eichenauer-Herrmann (1992, p. 173, 175) notes that
certain ICGs with power of two modulus have distributional disadvantages
compared to the "excellent quality" of ICGs with prime modulus. Indeed,
the documentation for INVCONG.32 remarks that makeinvc fails to pass many
of the Diehard tests (see the last section of file makef.txt from
the Diehard archive fortran.tar.gz. An ICG with prime
modulus should have better uniform properties than makeinvc, and Otmar
Lendl's ICG implementation might be speedier than makeinvc.
Also see pLab, described above at
Web Sites for Random Number Generators ,
for descriptions of some tests.
Protego Hardware Generator is a hardware RNG.
|