SSJ  3.3.1
Stochastic Simulation in Java
Public Member Functions | List of all members
NormalInverseFromDensityGen Class Reference

This class implements normal random variate generators using numerical inversion of the normal density as described in [44] . More...

Inheritance diagram for NormalInverseFromDensityGen:
[legend]
Collaboration diagram for NormalInverseFromDensityGen:
[legend]

Public Member Functions

 NormalInverseFromDensityGen (RandomStream stream, double mu, double sigma, double ueps, int order)
 Creates a normal random variate generator with parameters \(\mu=\) mu and \(\sigma\) = sigma, using stream stream. More...
 
 NormalInverseFromDensityGen (RandomStream stream, NormalDist dist, double ueps, int order)
 Similar to the first constructor, with the normal distribution dist.
 
 NormalInverseFromDensityGen (RandomStream stream, InverseDistFromDensity dist)
 Creates a new normal generator using the normal distribution dist and stream stream. More...
 
double getUepsilon ()
 Returns the \(u\)-resolution ueps.
 
int getOrder ()
 Returns the order of the interpolating polynomial.
 
- Public Member Functions inherited from NormalGen
 NormalGen (RandomStream s, double mu, double sigma)
 Creates a normal random variate generator with mean mu and standard deviation sigma, using stream s.
 
 NormalGen (RandomStream s)
 Creates a standard normal random variate generator with mean 0 and standard deviation 1, using stream s.
 
 NormalGen (RandomStream s, NormalDist dist)
 Creates a random variate generator for the normal distribution dist and stream s.
 
double getMu ()
 Returns the parameter \(\mu\) of this object.
 
double getSigma ()
 Returns the parameter \(\sigma\) of this object.
 
- 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.
 

Additional Inherited Members

- Static Public Member Functions inherited from NormalGen
static double nextDouble (RandomStream s, double mu, double sigma)
 Generates a variate from the normal distribution with parameters \(\mu= \) mu and \(\sigma= \) sigma, using stream s.
 
- Protected Member Functions inherited from NormalGen
void setParams (double mu, double sigma)
 Sets the parameters \(\mu\) and \(\sigma\) of this object.
 
- Protected Attributes inherited from NormalGen
double mu
 
double sigma = -1.0
 
- Protected Attributes inherited from RandomVariateGen
RandomStream stream
 
Distribution dist
 

Detailed Description

This class implements normal random variate generators using numerical inversion of the normal density as described in [44] .

It makes use of the class umontreal.ssj.probdist.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 & Destructor Documentation

◆ NormalInverseFromDensityGen() [1/2]

NormalInverseFromDensityGen ( RandomStream  stream,
double  mu,
double  sigma,
double  ueps,
int  order 
)

Creates a normal random variate generator with parameters \(\mu=\) mu and \(\sigma\) = 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() [2/2]

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.


The documentation for this class was generated from the following file: