public class Logarithmic extends AbstractContinousDistribution
Valid parameter ranges: 0 < p < 1.
Instance methods operate on a user supplied uniform random number generator; they are unsynchronized.
Implementation:
A.W. Kemp (1981): Efficient generation of logarithmically distributed pseudo-random variables, Appl. Statist. 30, 249-253.
Modifier and Type | Field and Description |
---|---|
protected double |
my_p |
randomGenerator
Constructor and Description |
---|
Logarithmic(double p,
MersenneTwisterFast randomGenerator)
Constructs a Logarithmic distribution.
|
Modifier and Type | Method and Description |
---|---|
double |
nextDouble()
Returns a random number from the distribution.
|
double |
nextDouble(double a)
Returns a random number from the distribution; bypasses the internal state.
|
void |
setState(double p)
Sets the distribution parameter.
|
java.lang.String |
toString()
Returns a String representation of the receiver.
|
apply, apply, getRandomGenerator, nextInt, setRandomGenerator
public Logarithmic(double p, MersenneTwisterFast randomGenerator)
public double nextDouble()
nextDouble
in class AbstractDistribution
public double nextDouble(double a)
public void setState(double p)
public java.lang.String toString()
toString
in class java.lang.Object