RNGstreams
Parallel Independent Random Number Streams

Description

Generate seeds for the L'Ecuyer random number generator to create multiple independent random number streams for use in parallel processing nodes.

Usage

clusterSetRNGStream(cl = NULL, iseed = NULL) 
nextRNGStream(seed)
nextRNGSubStream(seed)

Arguments

cl a cluster object. Usually generated by makeCluster. If not provided, the default cluster is used.
iseed an integer value. Used to generate a new seed for the "L'Ecuyer-CMRG" random number generator. If not provided, a random seed is selected.
seed a seed suitable for the "L'Ecuyer-CMRG" random number generator.

Details

Value
clusterSetRNGStreamreturns NULL invisibly.
nextRNGStreamreturns a length-7 integer vector suitable for the "L'Ecuyer-CMRG" random number generator.
nextRNGSubStreamreturns a length-7 integer vector suitable for the "L'Ecuyer-CMRG" random number generator.
References
L'Ecuyer, P. 1999. Good parameters and implementations for combined multiple recursive random number generators. Operations Research. Montreal, Canada: Univeristy of Montreal Volume 47, 159-164.
L'Ecuyer, P., et al. 2002. An object-oriented random-number package with many long streams and substreams. Operations Research. Montreal, Canada: Univeristy of Montreal Volume 50, 1073-5.
See Also
RNGkind, set.seed, makeCluster, mc.reset.stream
Examples
RNGkind("L'Ecuyer-CMRG")
runif(1)
.Random.seed
nextRNGStream(.Random.seed)
nextRNGSubStream(.Random.seed)

## Not run: cl <- makeCluster(2) clusterSetRNGStream(cl, iseed = 123) # do some other parallel works on clusters stopCluster(cl) ## End(Not run)

Package parallel version 6.1.1-7
Package Index