rpgm.rlnorm: Fast Simulation of Log-Normal Random Variables

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/rpgm.rlnorm.R

Description

The function rpgm.rlnorm uses rpgm.rnorm in order to simulate log-normal random variables faster than rlnorm.

Usage

1
rpgm.rlnorm(n, mean = 0, sd = 1)

Arguments

n

integer, number of simulations.

mean

double, the mean (or the vector of means) of the logarithm of the log-normal variable.

sd

double, the standard deviation (or the vector of standard deviations) of the logarithm of the log-normal variable.

Details

If mean or sd are not specified they assume the default values of 0 and 1, respectively.

Value

A vector of i.i.d. log-normal random variables.

Note

For a big number of simulations, it is in general two times faster than the usual rlnorm.

Author(s)

Nicolas Baradel - PGM Solutions

References

https://en.wikipedia.org/wiki/Ziggurat_algorithm

See Also

http://pgm-solutions.com/packages

Examples

1

Example output

[1] 8.469001 1.605017 2.424121 1.836935 1.071197

rpgm documentation built on March 18, 2018, 2:24 p.m.