Class Zeta
- All Implemented Interfaces:
DoubleFunction, IntFunction, Serializable, Cloneable
Zeta distribution.
If either ro > 100 or k > 10000 numerical problems in
computing the theoretical moments arise, therefore ro <= 100 and
k <= 10000 are recommended.
Static methods operate on a default uniform random number generator; they are synchronized.
Method: Acceptance/Rejection.
High performance implementation.
This is a port and adaption of Zeta.c from the C-RAND / WIN-RAND library.
C-RAND's implementation, in turn, is based upon
Valid parameter ranges: ro > 0 and pk >= 0.
Instance methods operate on a user supplied uniform random number generator; they are unsynchronized.
Implementation:
J. Dagpunar (1988): Principles of Random Variate Generation, Clarendon Press, Oxford.
- Version:
- 1.0, 09/24/99
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected doubleprotected doubleprotected doubleprotected doubleprotected doubleprotected doubleprotected doubleprotected static ZetaFields inherited from class AbstractDistribution
randomGeneratorFields inherited from class PersistentObject
serialVersionUID -
Constructor Summary
ConstructorsConstructorDescriptionZeta(double ro, double pk, RandomEngine randomGenerator) Constructs a Zeta distribution. -
Method Summary
Modifier and TypeMethodDescriptionprotected longgenerateZeta(double ro, double pk, RandomEngine randomGenerator) Returns a zeta distributed random number.intnextInt()Returns a random number from the distribution.voidsetState(double ro, double pk) Sets the parameters.static intstaticNextInt(double ro, double pk) Returns a random number from the distribution.toString()Returns a String representation of the receiver.private static voidxstaticSetRandomGenerator(RandomEngine randomGenerator) Sets the uniform random number generated shared by all static methods.Methods inherited from class AbstractDiscreteDistribution
nextDoubleMethods inherited from class AbstractDistribution
apply, apply, clone, getRandomGenerator, makeDefaultGenerator, setRandomGenerator
-
Field Details
-
ro
protected double ro -
pk
protected double pk -
c
protected double c -
d
protected double d -
ro_prev
protected double ro_prev -
pk_prev
protected double pk_prev -
maxlongint
protected double maxlongint
-
-
Constructor Details
-
Zeta
Constructs a Zeta distribution.
-
-
Method Details
-
generateZeta
Returns a zeta distributed random number. -
nextInt
public int nextInt()Returns a random number from the distribution.- Specified by:
nextIntin classAbstractDiscreteDistribution
-
setState
public void setState(double ro, double pk) Sets the parameters. -
staticNextInt
public static int staticNextInt(double ro, double pk) Returns a random number from the distribution. -
toString
-
xstaticSetRandomGenerator
Sets the uniform random number generated shared by all static methods.- Parameters:
randomGenerator- the new uniform random number generator to be shared.
-