IMSL C# Numerical Library

Random Class

Generate uniform and non-uniform random number distributions.

For a list of all members of this type, see Random Members.

System.Object
   System.Random
      Imsl.Stat.Random

public class Random : Random

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

The non-uniform distributions are generated from a uniform distribution. By default, this class uses the uniform distribution generated by the base class Random. If the multiplier is set in this class then a multiplicative congruential method is used. The form of the generator is

x_i\equiv c
            x_{i-1}{\rm mod}(2^{31}-1)
Each x_i is then scaled into the unit interval (0,1). If the multiplier, c, is a primitive root modulo 2^{31}-1 (which is a prime), then the generator will have a maximal period of 2^{31}-2. There are several other considerations, however. See Knuth (1981) for a good general discussion. Possible values for c are 16807, 397204094, and 950706376. The selection is made by the property Multiplier. Evidence suggests that the performance of 950706376 is best among these three choices (Fishman and Moore 1982).

Alternatively, one can select a 32-bit or 64-bit Mersenne Twister generator by first instantiating MersenneTwister or MersenneTwister64. These generators have a period of 2^{19937}-1 and a 623-dimensional equidistribution property. See Matsumoto et al. 1998 for details.

The generation of uniform (0,1) numbers is done by the method NextFloat.

Requirements

Namespace: Imsl.Stat

Assembly: ImslCS (in ImslCS.dll)

See Also

Random Members | Imsl.Stat Namespace | Example