<< Random Number Generator Random Number Generator distfun_genget >>

Distfun >> Distfun > Random Number Generator > Random Number Generators

Random Number Generators

An overview of the Random Number Generators of the Distfun toolbox.

Purpose

The non-uniform random numbers in this toolbox are all based on a unique uniform random number generator (RNG). This toolbox provides several RNG, so that the user can see the effect of the generator.

The random number generators in this toolbox are the following.

Notes on streams

The "clcg4" generator may be used as the others generators, but additionnaly provides streams and substream. Indeed, it offers the advantage to be split in several (101) virtual generators with non over-lapping sequences. Indeed, when you use a classic generator you may change the initial state (seeds) in order to get another sequence but you there is no guarantee to get a completely different one. With clcg4, each virtual generator is associated with its own sequence, and the sequences are guaranteed to be different. In other words, this is as if there was 101 different random number generators, each one producing its own sequence of random numbers.

Each virtual generator corresponds to a stream of 2^72 values which is further split into V=2^31 substreams of length W=2^41. For a given virtual generator, the distfun_streaminit function let us return at the beginning of the sequence or at the beginning of the current segment or to go directly at the next segment. We may also change the initial state (seed) of the generator 0 with the "distfun_seedset" function which change also the initial state of the other virtual generators so as to get synchronisation. In other words, depending on the new initial state of virtual generator g=0, the initial state of the virtual generator g=1, 2, ..., 100 are recomputed so as to get 101 non over-lapping sequences.

An example of the need of the splitting capabilities of clcg4 is as follows. Two statistical techniques are being compared on data of different sizes. The first technique uses bootstrapping and is thought to be as accurate using less data than the second method which employs only brute force. For the first method, a data set of size uniformly distributed between 25 and 50 will be generated. Then the data set of the specified size will be generated and analyzed. The second method will choose a data set size between 100 and 200, generate the data and analyze it. This process will be repeated 1000 times. For variance reduction, we want the random numbers used in the two methods to be the same for each of the 1000 comparisons. But method two will use more random numbers than method one and without this package, synchronization might be difficult. With clcg4, it is a snap. Use generator 0 to obtain the sample size for method one and generator 1 to obtain the data. Then reset the state to the beginning of the current stream and do the same for the second method. This assures that the initial data for method two is that used by method one. When both have concluded, advance the stream for both generators.

Technical details

Authors


Report an issue
<< Random Number Generator Random Number Generator distfun_genget >>