This class implements exponential random variate generators using numerical inversion of the exponential density as described in. More...
Public Member Functions | |
| ExponentialInverseFromDensityGen (RandomStream stream, double lambda, double ueps, int order) | |
| Creates an exponential random variate generator with parameter. | |
| ExponentialInverseFromDensityGen (RandomStream stream, ExponentialDist dist, double ueps, int order) | |
| Similar to the above constructor, with the exponential distribution dist. | |
| ExponentialInverseFromDensityGen (RandomStream stream, InverseDistFromDensity dist) | |
| Creates a new exponential generator using the exponential distribution dist and stream stream. | |
| double | getUepsilon () |
| Returns the \(u\)-resolution ueps. | |
| int | getOrder () |
| Returns the order of the interpolating polynomial. | |
| Public Member Functions inherited from umontreal.ssj.randvar.ExponentialGen | |
| ExponentialGen (RandomStream s, double lambda) | |
| Creates an exponential random variate generator with parameter. | |
| ExponentialGen (RandomStream s, ExponentialDist dist) | |
| Creates a new generator for the exponential distribution dist and stream s. | |
| double | getLambda () |
| Returns the \(\lambda\) associated with this object. | |
| Public Member Functions inherited from umontreal.ssj.randvar.RandomVariateGen | |
| RandomVariateGen (RandomStream s, Distribution dist) | |
| Creates a new random variate generator from the distribution dist, using stream s. | |
| double | nextDouble () |
| Generates a random number from the continuous distribution contained in this object. | |
| void | nextArrayOfDouble (double[] v, int start, int n) |
| Generates n random numbers from the continuous distribution contained in this object. | |
| 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. | |
| RandomStream | getStream () |
| Returns the umontreal.ssj.rng.RandomStream used by this generator. | |
| 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. | |
| String | toString () |
| Returns a String containing information about the current generator. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from umontreal.ssj.randvar.ExponentialGen | |
| static double | nextDouble (RandomStream s, double lambda) |
| Uses inversion to generate a new exponential variate with parameter. | |
| Protected Member Functions inherited from umontreal.ssj.randvar.ExponentialGen | |
| void | setParams (double lam) |
| Sets the parameter \(\lambda= \) lam of this object. | |
This class implements exponential random variate generators using numerical inversion of the exponential density as described in.
[43] . It makes use of the class umontreal.ssj.probdist.InverseDistFromDensity. Generating exponential random variables by inversion usually requires the computation of a logarithm for each generated random number. Numerical inversion precomputes a set of tables that will speed up the generation of random variables. This is useful if one wants to generate a large number of random variables.
Definition at line 47 of file ExponentialInverseFromDensityGen.java.
| umontreal.ssj.randvar.ExponentialInverseFromDensityGen.ExponentialInverseFromDensityGen | ( | RandomStream | stream, |
| double | lambda, | ||
| double | ueps, | ||
| int | order ) |
Creates an exponential random variate generator with parameter.
\(\lambda\) = lambda, using stream stream. It uses numerical inversion with precomputed tables. The \(u\)-resolution ueps is the desired absolute error in the cdf, and order is the degree of the Newton interpolating polynomial over each interval.
Definition at line 57 of file ExponentialInverseFromDensityGen.java.
| umontreal.ssj.randvar.ExponentialInverseFromDensityGen.ExponentialInverseFromDensityGen | ( | RandomStream | stream, |
| ExponentialDist | dist, | ||
| double | ueps, | ||
| int | order ) |
Similar to the above constructor, with the exponential distribution dist.
Definition at line 70 of file ExponentialInverseFromDensityGen.java.
| umontreal.ssj.randvar.ExponentialInverseFromDensityGen.ExponentialInverseFromDensityGen | ( | RandomStream | stream, |
| InverseDistFromDensity | dist ) |
Creates a new exponential generator using the exponential distribution dist and stream stream.
dist may be obtained by calling method getDistribution, after using one of the other constructors to create the precomputed tables. This is useful when one needs many generators using the same exponential distribution (same \(\lambda\)). Precomputing tables for numerical inversion is costly; thus using only one set of tables for many generators is more efficient. The first ExponentialInverseFromDensityGen generator using the other constructors creates the precomputed tables. Then all other streams use this constructor with the same set of tables.
Definition at line 90 of file ExponentialInverseFromDensityGen.java.
| int umontreal.ssj.randvar.ExponentialInverseFromDensityGen.getOrder | ( | ) |
Returns the order of the interpolating polynomial.
Definition at line 106 of file ExponentialInverseFromDensityGen.java.
| double umontreal.ssj.randvar.ExponentialInverseFromDensityGen.getUepsilon | ( | ) |
Returns the \(u\)-resolution ueps.
Definition at line 99 of file ExponentialInverseFromDensityGen.java.