This class implements normal random variate generators using numerical inversion of the normal density as described in [43] . More...
Public Member Functions | |
| NormalInverseFromDensityGen (RandomStream stream, double mu, double sigma, double ueps, int order) | |
| Creates a normal random variate generator with parameters. | |
| 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. | |
| double | getUepsilon () |
| Returns the \(u\)-resolution ueps. | |
| int | getOrder () |
| Returns the order of the interpolating polynomial. | |
| Public Member Functions inherited from umontreal.ssj.randvar.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 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.NormalGen | |
| static double | nextDouble (RandomStream s, double mu, double sigma) |
| Generates a variate from the normal distribution with parameters. | |
| Protected Member Functions inherited from umontreal.ssj.randvar.NormalGen | |
| void | setParams (double mu, double sigma) |
| Sets the parameters \(\mu\) and \(\sigma\) of this object. | |
This class implements normal random variate generators using numerical inversion of the normal density as described in [43] .
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.
Definition at line 45 of file NormalInverseFromDensityGen.java.
| umontreal.ssj.randvar.NormalInverseFromDensityGen.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.
Definition at line 56 of file NormalInverseFromDensityGen.java.
| umontreal.ssj.randvar.NormalInverseFromDensityGen.NormalInverseFromDensityGen | ( | RandomStream | stream, |
| NormalDist | dist, | ||
| double | ueps, | ||
| int | order ) |
Similar to the first constructor, with the normal distribution dist.
Definition at line 69 of file NormalInverseFromDensityGen.java.
| umontreal.ssj.randvar.NormalInverseFromDensityGen.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.
Definition at line 90 of file NormalInverseFromDensityGen.java.
| int umontreal.ssj.randvar.NormalInverseFromDensityGen.getOrder | ( | ) |
Returns the order of the interpolating polynomial.
Definition at line 106 of file NormalInverseFromDensityGen.java.
| double umontreal.ssj.randvar.NormalInverseFromDensityGen.getUepsilon | ( | ) |
Returns the \(u\)-resolution ueps.
Definition at line 99 of file NormalInverseFromDensityGen.java.