draw.logarithmic {UnivRNG} | R Documentation |
This function implements pseudo-random number generation for a logarithmic distribution with pmf
f(x|\theta) = - \frac{\theta^{x}}{x\log(1-\theta)}
for x=1,2,3,...
and 0 < \theta < 1
.
draw.logarithmic(nrep,theta)
nrep |
Number of data points to generate. |
theta |
Rate parameter of the desired logarithmic distribution. |
A list of length five containing generated data, the theoretical mean, the empirical mean, the theoretical variance, and the empirical variance with names y, theo.mean, emp.mean, theo.var, and emp.var, respectively.
Kemp, A. W. Efficient generation of logarithmically distributed pseudo-random variables. Applied Statistics, 30, 249-253.
draw.logarithmic(nrep=100000,theta=0.33)
draw.logarithmic(nrep=100000,theta=0.66)