draw.logarithmic {UnivRNG}R Documentation

Generates variates from logarithmic distribution

Description

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.

Usage

draw.logarithmic(nrep,theta)

Arguments

nrep

Number of data points to generate.

theta

Rate parameter of the desired logarithmic distribution.

Value

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.

References

Kemp, A. W. Efficient generation of logarithmically distributed pseudo-random variables. Applied Statistics, 30, 249-253.

Examples

draw.logarithmic(nrep=100000,theta=0.33)

draw.logarithmic(nrep=100000,theta=0.66)

[Package UnivRNG version 1.2.3 Index]