draw.zeta {UnivRNG} | R Documentation |
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}
.
draw.zeta(nrep, alpha)
nrep |
Number of data points to generate. |
alpha |
Parameter of the desired zeta 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.
Devroye, L. (1986). Non-Uniform random variate generation. New York: Springer-Verlag.
draw.zeta(nrep=100000,alpha=4)