SSJ
3.3.1
Stochastic Simulation in Java
|
This class implements random variate generators for the (discrete) logarithmic distribution. More...
Public Member Functions | |
LogarithmicGen (RandomStream s, double theta) | |
Creates a logarithmic random variate generator with parameters \(\theta= \) theta and default value \(\theta_0 = 0.96\), using stream s . | |
LogarithmicGen (RandomStream s, double theta, double theta0) | |
Creates a logarithmic random variate generator with parameters \(\theta= \) theta and \(\theta_0 = \mathtt{theta0}\), using stream s . | |
LogarithmicGen (RandomStream s, LogarithmicDist dist) | |
Creates a new generator with distribution dist and stream s , with default value \(\theta_0 = 0.96\). | |
LogarithmicGen (RandomStream s, LogarithmicDist dist, double theta0) | |
Creates a new generator with distribution dist and stream s , with \(\theta_0 = \mathtt{theta0}\). | |
int | nextInt () |
double | getTheta () |
Returns the \(\theta\) associated with this object. | |
double | getTheta0 () |
Returns the \(\theta_0\) associated with this object. | |
Public Member Functions inherited from RandomVariateGenInt | |
RandomVariateGenInt (RandomStream s, DiscreteDistributionInt dist) | |
Creates a new random variate generator for the discrete distribution dist , using stream s . More... | |
int | nextInt () |
Generates a random number (an integer) from the discrete distribution contained in this object. More... | |
void | nextArrayOfInt (int[] v, int start, int n) |
Generates n random numbers from the discrete distribution contained in this object. More... | |
int [] | nextArrayOfInt (int n) |
Generates n random numbers from the discrete distribution contained in this object, and returns them in a new array of size n . More... | |
DiscreteDistributionInt | getDistribution () |
Returns the umontreal.ssj.probdist.DiscreteDistributionInt used by this generator. More... | |
Public Member Functions inherited from RandomVariateGen | |
RandomVariateGen (RandomStream s, Distribution dist) | |
Creates a new random variate generator from the distribution dist , using stream s . More... | |
double | nextDouble () |
Generates a random number from the continuous distribution contained in this object. More... | |
void | nextArrayOfDouble (double[] v, int start, int n) |
Generates n random numbers from the continuous distribution contained in this object. More... | |
double [] | nextArrayOfDouble (int n) |
Generates n random numbers from the continuous distribution contained in this object, and returns them in a new array of size n . More... | |
RandomStream | getStream () |
Returns the umontreal.ssj.rng.RandomStream used by this generator. More... | |
void | setStream (RandomStream stream) |
Sets the umontreal.ssj.rng.RandomStream used by this generator to stream . | |
Distribution | getDistribution () |
Returns the umontreal.ssj.probdist.Distribution used by this generator. More... | |
String | toString () |
Returns a String containing information about the current generator. | |
Static Public Member Functions | |
static int | nextInt (RandomStream s, double theta) |
Uses stream s to generate a new variate from the logarithmic distribution with parameter \(\theta=\) theta . | |
Additional Inherited Members | |
Protected Attributes inherited from RandomVariateGen | |
RandomStream | stream |
Distribution | dist |
This class implements random variate generators for the (discrete) logarithmic distribution.
\[ p(x) = \frac{-\theta^x}{x \log(1 - \theta)} \qquad\mbox{ for } x = 1,2,…, \tag{flogar} \]
where \(0 < \theta<1\). It uses inversion with the LS chop-down algorithm if \(\theta< \theta_0\) and the LK transformation algorithm if \(\theta\ge\theta_0\), as described in [104] . The threshold \(\theta_0\) can be specified when invoking the constructor. Its default value is \(\theta_0 = 0.96\), as suggested in [104] .
A local copy of the parameter \(\theta\) is maintained in this class.