ziggurat {SuppDists} | R Documentation |
Generates normal and exponential random pseudo-random numbers by the method of Marsaglia and Tsang.
rziggurat(n, normal=TRUE, new.start=FALSE, seed=556677)
n |
number of values to generate. If n is a vector, length(n) values will be generated |
normal |
logical scalar; if TRUE normal values are produced, otherwise exponential values |
new.start |
logical scalar. If TRUE the generator will be started afresh using the seed |
seed |
scalar 32 bit starting integer |
Generates a vector of real pseudo random numbers.
This function does not work properly on LP64 machines which use 64 bit longs.
This implementation running in R is approximately three times as fast as rnorm().
Bob Wheeler bwheelerg@gmail.com
Marsaglia, George, and Tsang, Wai Wan. 2000. The Ziggurat method for generating random variables. Journal of Statistical software. 5-8. http://www.jstatsoft.org/v05/i08/
rziggurat(50,new.start=TRUE) rziggurat(50) rziggurat(50,new.start=TRUE)