SSJ
V. 2.6.

umontreal.iro.lecuyer.randvar
Class NormalInverseFromDensityGen

java.lang.Object
  extended by umontreal.iro.lecuyer.randvar.RandomVariateGen
      extended by umontreal.iro.lecuyer.randvar.NormalGen
          extended by umontreal.iro.lecuyer.randvar.NormalInverseFromDensityGen

public class NormalInverseFromDensityGen
extends NormalGen

This class implements normal random variate generators using numerical inversion of the normal density as described in. It makes use of the class InverseDistFromDensity. A set of tables are precomputed to speed up the generation of normal random variables by numerical inversion. This will be useful if one wants to generate a large number of random variables.


Constructor Summary
NormalInverseFromDensityGen(RandomStream stream, double mu, double sigma, double ueps, int order)
          Creates a normal random variate generator with parameters μ = mu and σ = sigma, using stream stream.
NormalInverseFromDensityGen(RandomStream stream, InverseDistFromDensity dist)
          Creates a new normal generator using the normal distribution dist and stream stream.
NormalInverseFromDensityGen(RandomStream stream, NormalDist dist, double ueps, int order)
          Similar to the first constructor, with the normal distribution dist.
 
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.NormalGen
getMu, getSigma, 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

NormalInverseFromDensityGen

public NormalInverseFromDensityGen(RandomStream stream,
                                   double mu,
                                   double sigma,
                                   double ueps,
                                   int order)
Creates a normal random variate generator with parameters μ = mu and σ = sigma, 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.


NormalInverseFromDensityGen

public NormalInverseFromDensityGen(RandomStream stream,
                                   NormalDist dist,
                                   double ueps,
                                   int order)
Similar to the first constructor, with the normal distribution dist.


NormalInverseFromDensityGen

public NormalInverseFromDensityGen(RandomStream stream,
                                   InverseDistFromDensity dist)
Creates a new normal generator using the normal 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 normal distribution. Precomputing tables for numerical inversion is costly; thus using only one set of tables for many generators is more efficient. The first NormalInverseFromDensityGen 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.