VS provides pseudorandom, quasi-random, and non-deterministic random number generators. This includes the following BRNGs, which differ in speed and other properties:
- Sobol quasi-random number generator [ Sobol76 ], [ Bratley88 ], which works in arbitrary dimension. For dimensions greater than 40 the user should supply initialization parameters (initial direction numbers and primitive polynomials or direction numbers) by usingvslNewStreamExfunction. See additional details on interface for registration of the parameters in the library in VS Notes .
- Niederreiter quasi-random number generator [ Bratley92 ], which works in arbitrary dimension. For dimensions greater than 318 the user should supply initialization parameters (irreducible polynomials or direction numbers) by usingvslNewStreamExfunction. See additional details on interface for registration of the parameters in the library in VS Notes .
- You can use a non-deterministic random number generator only if the underlying hardware supports it. For instructions on how to detect if an Intel CPU supports a non-deterministic random number generator see, for example,Chapter 8: Post-32nm Processor Instructionsin [ AVX ] orChapter 4: RdRand Instruction Usagein [ BMT ].The time required by some non-deterministic sources to generate a random number is not constant, so you might have to make multiple requests before the next random number is available. VS limits the number of retries for requests to the non-deterministic source to 10. You can redefine the maximum number of retries during the initialization of the non-deterministic random number generator with the vslNewStreamEx function.
See some testing results for the generators in VS Notes and comparative performance data at https://software.intel.com/en-us/articles/intel-math-kernel-library-documentation.
VS provides means of registration of such user-designed generators through the steps described in Advanced Service Routines .
For some basic generators, VS provides two methods of creating independent random streams in multiprocessor computations, which are the leapfrog method and the block-splitting method. These sequence splitting methods are also useful in sequential Monte Carlo.
In addition, MT2203 pseudorandom number generator is a set of 6024 generators designed to create up to 6024 independent random sequences, which might be used in parallel Monte Carlo simulations. Another generator that has the same feature is Wichmann-Hill. It allows creating up to 273 independent random streams. The properties of the generators designed for parallel computations are discussed in detail in [ Coddington94 ].
You may want to design and use your own basic generators. VS provides means of registration of such user-designed generators through the steps described in Advanced Service Routines .
There is also an option to utilize externally generated random numbers in VS distribution generator routines. For this purpose VS provides three additional basic random number generators:
- for external random data packed in 32-bit integer array
- for external random data stored in double precision floating-point array; data is supposed to be uniformly distributed over (a,b) interval
- for external random data stored in single precision floating-point array; data is supposed to be uniformly distributed over (a,b) interval.