draw.zeta {UnivRNG} | R Documentation |
Generates variates from Zeta (Zipf) distribution
Description
This function implements pseudo-random number generation for a Zeta (Zipf) distribution with pmf
f(x|\alpha)=\frac{1}{\zeta(\alpha)x^{\alpha}}
for x=1,2,3,...
and \alpha > 1
where \zeta(\alpha)=\sum_{x=1}^{\infty} x^{-\alpha}
.
Usage
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
draw.zeta(nrep=100000,alpha=4)
[Package UnivRNG version 1.2.3 Index]