draw.zeta: Generates variates from Zeta (Zipf) distribution

Description Usage Arguments Value References Examples

View source: R/draw.zeta.R

Description

This function implements pseudo-random number generation for a Zeta (Zipf) distribution with pmf

f(x|α)=\frac{1}{ζ(α)x^{α}}

for x=1,2,3,... and α > 1 where ζ(α)=∑_{x=1}^{∞} x^{-α}.

Usage

1
draw.zeta(nrep, alpha)

Arguments

nrep

Number of data points to generate.

alpha

Parameter of the desired zeta 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

Devroye, L. (1986). Non-Uniform random variate generation. New York: Springer-Verlag.

Examples

1
draw.zeta(nrep=100000,alpha=4)

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