VSL provides an option of producing an exact copy of a generated stream by calling the vslCopyStream function:
Typically, to get one more correct decimal digit in Monte Carlo, you need to increase the sample by the factor of 100. That makes Monte Carlo applications computationally expensive. Some of them take days or weeks while others may take several months of computations. For such applications, saving intermediate results to a file is essential to be able to continue computation using that result in case the application is terminated intentionally or abnormally.
One of the basic requirements for random number streams is their mutual independence and lack of intercorrelation. Even if you want random number samplings to be correlated, such correlation should be controllable.
You can get independent streams using various methods. This document discusses the following methods supported by VSL:
If you want to use a BRNG not included in VSL together with VSL distribution generators, you can register your generator using the vslRegisterBrng function. In this case, your own BRNG should meet VSL BRNG interface requirements. Otherwise, you can use VSL abstract BRNGs as a wrapper.
You can use a source of uniformly distributed random numbers to generate both discrete and continuous distributions, which is implemented through a number of methods briefly described below.
The probability distribution of a one-dimensional variate X may be most generally presented in terms of cumulative distribution function (CDF):
Any CDF is defined on the whole real axis and is monotonically increasing, where
The cumulative distribution functions and their inverses may often be much more complex computationally than the probability density function (for continuous distributions) and the probability mass function (for discrete distributions).
You can split the initial distribution into several simpler distributions:
In this case, random numbers for each of the distributions Fi(x) are easy to generate. An appropriate algorithm may be as follows:
To improve the efficiency of the algorithms based on the general methods described above, you may have to use special properties of distributions. For example, use of polar coordinates for a pair of independent normal variates enables you to develop an efficient method of random number generation based on 2D inverse transformation known as the Box-Muller method:
Using the distribution generators in the application, you can expect the obtained random numbers to belong to definitional domain of the corresponding distribution irrespective of its parameters.