rpgm.rnorm: Fast Simulation of Normal Random Variables
Description
The function rpgm.rnorm uses the Ziggurat algorithm with a 128-regions table, in order to simulate normal random variables faster than rnorm.
Usage
rpgm.rnorm(n, mean = 0, sd = 1, nthreads = 1L)
Arguments
n
integer, number of simulations.
mean
double, the mean (or the vector of means).
sd
double, the standard deviation (or the vector of standard deviations).
nthreads
integer, the number of threads to use for parallelism.
Value
A vector of i.i.d. normal random variables.
Details
If mean or sd are not specified they assume the default values of 0 and 1, respectively. By default the number of threads is 1 so there is no multi-core.