draw.logarithmic: Generates variates from logarithmic distribution

Description Usage Arguments Value References Examples

View source: R/draw.logarithmic.R

Description

This function implements pseudo-random number generation for a logarithmic distribution with pmf

f(x|θ) = - \frac{θ^{x}}{x\log(1-θ)}

for x=1,2,3,... and 0 < θ < 1.

Usage

1
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

1
2
3
draw.logarithmic(nrep=100000,theta=0.33)

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

UnivRNG documentation built on March 6, 2021, 1:08 a.m.