Generating random variates from a Log(p) distribution with probability mass function
p_k = p^k/(log(1p)k), k in IN,
where p in (0,1). The implemented algorithm is the one named “LK” in Kemp (1981).
1  rlog(n, p, Ip = 1  p)

n 
sample size, that is, length of the resulting vector of random variates. 
p 
parameter in (0,1). 
Ip 
= 1  p, possibly more accurate, e.g, when p ~= 1. 
For documentation and didactical purposes, rlogR
is a pureR
implementation of rlog
. However, rlogR
is not as fast as
rlog
(the latter being implemented in C).
A vector of positive integer
s of length n
containing the
generated random variates.
Kemp, A. W. (1981), Efficient Generation of Logarithmically Distributed PseudoRandom Variables, Journal of the Royal Statistical Society: Series C (Applied Statistics) 30, 3, 249–253.
1 2 3 4 5 6 
Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.