Rnorm: Simulation of random values from a normal distribution

View source: R/random_values_simulation.R

Simulation of random values from a normal distributionR Documentation

Simulation of random values from a normal distribution

Description

Simulation of random values from a normal distribution.

Usage

Rnorm(n, m = 0, s = 1, seed = NULL)

Arguments

n

The sample size.

m

The mean, set to 0 by default.

s

The standard devation, set to 1 by default.

seed

If you want the same to be generated again use a seed for the generator, an integer number.

Details

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.

Value

A vector with n values.

Author(s)

Michail Tsagris

R implementation and documentation: Michail Tsagris <mtsagris@uoc.gr>

See Also

matrnorm, rvonmises, rvmf, rmvnorm

Examples

x <- Rnorm(500)

Rfast documentation built on Nov. 9, 2023, 5:06 p.m.