Return a random value chosen from the Zipf distribution.
The return value is an integer drawn from the probability distribution ::math:
p(x)=\frac{x^{-\alpha}}{\zeta(\alpha,x_{min})},
where is the Hurwitz zeta function.
Parameters : | alpha : float
xmin : int
seed : int
|
---|---|
Returns : | x : int
|
Raises : | ValueError: :
|
Notes
The rejection algorithm generates random values for a the power-law distribution in uniformly bounded expected time dependent on parameters. See [1] for details on its operation.
References
Examples
>>> nx.zipf_rv(alpha=2, xmin=3, seed=42)