Simulation of random values from a normal distribution
Simulation of random values from a normal distribution.
Rnorm(n, m = 0, s = 1)
n |
The sample size. |
m |
The mean, set to 0 by default. |
s |
The standard devation, set to 1 by default. |
By using the Ziggurat method of generating standard normal variates, this function is really fast when you want to generate large vectors. For less than 2,000 this might make no difference when compared with R's "rnorm", but for 10,000 this will be 6-7 times faster.
A vector with n values.
Michail Tsagris
R implementation and documentation: Michail Tsagris <mtsagris@yahoo.gr>
x <- Rnorm(500)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.