DiscreteSampler
public class RejectionInversionZipfSampler extends SamplerBase implements DiscreteSampler
Constructor | Description |
---|---|
RejectionInversionZipfSampler(org.apache.commons.rng.UniformRandomProvider rng,
int numberOfElements,
double exponent) |
Modifier and Type | Method | Description |
---|---|---|
int |
sample() |
Rejection inversion sampling method for a discrete, bounded Zipf
distribution that is based on the method described in
Wolfgang Hörmann and Gerhard Derflinger.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
nextDouble, nextInt, nextInt, nextLong
public RejectionInversionZipfSampler(org.apache.commons.rng.UniformRandomProvider rng, int numberOfElements, double exponent)
rng
- Generator of uniformly distributed random numbers.numberOfElements
- Number of elements.exponent
- Exponent.java.lang.IllegalArgumentException
- if numberOfElements <= 0
or exponent <= 0
.public int sample()
Wolfgang Hörmann and Gerhard Derflinger. "Rejection-inversion to generate variates from monotone discrete distributions",
ACM Transactions on Modeling and Computer Simulation (TOMACS) 6.3 (1996): 169-184.
sample
in interface DiscreteSampler
public java.lang.String toString()
toString
in class SamplerBase
Copyright © 2016–2018 The Apache Software Foundation. All rights reserved.