This library provides tools to simplify recording and resetting the random
number generator, to help make monte carlo experiments easily reproducible.
It uses the R/S tools for setting the seed, but also records and sets
the mechanism for converting uniform numbers to normally distributed numbers.
(It could be extended to other transformations, but I have not done that.)
The setRNG function would typically be called by simulation programs (see
example) to set the
RNG information if given, and record the RNG information
in all cases. This information can be returned with the result
of the simulation. That way the simulation can always be reproduced if
necessary.
The library also implements an approach to random number generation
which allows the same random experiments to be replicated in S and R.
The functions in the S/ directory allow the R results using
Wichmann-Hill and Box-Muller to be replicated in S. These were done with
the aid of an example from B. D. Ripley. (The files in the S/
directory of the package are for use with S not R.)
These functions are intended primarily as a way to confirm that simulations and
estimations with simulated data work in
the same way in both S and R, not as an improved RNG. (It has only been tested
in Splus 3.3) Default and other
RNGs can still be used and are preferred for both speed and
theoretical reasons.