powered by
The function rpgm.geom uses rpgm.exp in order to simulate geometric random variables faster than rgeom.
rpgm.exp
rgeom
rpgm.rgeom(n, prob)
integer, number of simulations.
double, probability.
A vector of i.i.d. geometric random variables.
The argument prob must be in ]0, 1], else, NA are produced.
prob
https://en.wikipedia.org/wiki/Ziggurat_algorithm
http://pgm-solutions.com/packages
# NOT RUN { rpgm.rgeom(5, 0.5) # }
Run the code above in your browser using DataLab