SSJ
V. 2.6.

umontreal.iro.lecuyer.randvar
Class ExponentialInverseFromDensityGen

java.lang.Object
  extended by umontreal.iro.lecuyer.randvar.RandomVariateGen
      extended by umontreal.iro.lecuyer.randvar.ExponentialGen
          extended by umontreal.iro.lecuyer.randvar.ExponentialInverseFromDensityGen

public class ExponentialInverseFromDensityGen
extends ExponentialGen

This class implements exponential random variate generators using numerical inversion of the exponential density as described in. It makes use of the class 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.


Constructor Summary
ExponentialInverseFromDensityGen(RandomStream stream, double lambda, double ueps, int order)
          Creates an exponential random variate generator with parameter λ = lambda, using stream stream.
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.
 
Method Summary
 int getOrder()
          Returns the order of the interpolating polynomial.
 double getUepsilon()
          Returns the u-resolution ueps.
 
Methods inherited from class umontreal.iro.lecuyer.randvar.ExponentialGen
getLambda, nextDouble
 
Methods inherited from class umontreal.iro.lecuyer.randvar.RandomVariateGen
getDistribution, getStream, nextArrayOfDouble, nextDouble, setStream, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExponentialInverseFromDensityGen

public ExponentialInverseFromDensityGen(RandomStream stream,
                                        double lambda,
                                        double ueps,
                                        int order)
Creates an exponential random variate generator with parameter λ = 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.


ExponentialInverseFromDensityGen

public ExponentialInverseFromDensityGen(RandomStream stream,
                                        ExponentialDist dist,
                                        double ueps,
                                        int order)
Similar to the above constructor, with the exponential distribution dist.


ExponentialInverseFromDensityGen

public 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 λ). 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.

Method Detail

getUepsilon

public double getUepsilon()
Returns the u-resolution ueps.


getOrder

public int getOrder()
Returns the order of the interpolating polynomial.


SSJ
V. 2.6.

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.