rpgm.rgeom: Fast Simulation of Geometric Random Variables

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

View source: R/rpgm.rgeom.R

Description

The function rpgm.geom uses rpgm.exp in order to simulate geometric random variables faster than rgeom.

Usage

1
rpgm.rgeom(n, prob)

Arguments

n

integer, number of simulations.

prob

double, probability.

Details

The argument prob must be in ]0, 1], else, NA are produced.

Value

A vector of i.i.d. geometric random variables.

Note

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

Author(s)

Nicolas Baradel - PGM Solutions

References

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

See Also

http://pgm-solutions.com/packages

Examples

1
rpgm.rgeom(5, 0.5)

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