This class implements noncentral chi square random variate generators using the additive property of the noncentral chi square distribution. More...
Public Member Functions | |
| ChiSquareNoncentralGamGen (RandomStream stream, double nu, double lambda) | |
| Creates a noncentral chi square random variate generator with with. | |
| double | nextDouble () |
| Generates a random number from the continuous distribution contained in this object. | |
| Public Member Functions inherited from umontreal.ssj.randvar.ChiSquareNoncentralGen | |
| ChiSquareNoncentralGen (RandomStream s, double nu, double lambda) | |
| Creates a noncentral chi square random variate generator with nu. | |
| ChiSquareNoncentralGen (RandomStream s, ChiSquareNoncentralDist dist) | |
| Create a new generator for the distribution dist and stream s. | |
| double | getNu () |
| Returns the value of \(\nu\) of this object. | |
| double | getLambda () |
| Returns the value of \(\lambda\) for 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. | |
| 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. | |
Static Public Member Functions | |
| static double | nextDouble (RandomStream stream, double nu, double lambda) |
| Generates a variate from the noncentral chi square distribution with parameters \(\nu= \) nu and \(\lambda= \) lambda using stream stream, as described above. | |
Additional Inherited Members | |
| Protected Member Functions inherited from umontreal.ssj.randvar.ChiSquareNoncentralGen | |
| void | setParams (double nu, double lambda) |
| Sets the parameters \(\nu=\) nu and \(\lambda= \) lambda of this object. | |
This class implements noncentral chi square random variate generators using the additive property of the noncentral chi square distribution.
[111] . It uses the following algorithm: generate a real \(X \sim N(\sqrt{\lambda}, 1)\) from a normal distribution with variance 1, generate a real \(Y \sim\Gamma((\nu- 1)/2, 1/2)\) from a gamma distribution, then return \(X^2 + Y\). Here \(\nu\) is the number of degrees of freedom and \(\lambda\) is the noncentrality parameter.
To generate the normal variates, one uses the fast acceptance-complement ratio method in [83] (see class umontreal.ssj.randvar.NormalACRGen ). To generate the gamma variates, one uses acceptance-rejection for \(\alpha<1\), and acceptance-complement for \(\alpha\ge1\), as proposed in [2], [4] (see class umontreal.ssj.randvar.GammaAcceptanceRejectionGen ).
This noncentral chi square generator is faster than the generator
umontreal.ssj.randvar.ChiSquareNoncentralPoisGen on the next page of this guide . For small \(\lambda\), it is nearly twice as fast. As \(\lambda\) increases, it is still faster but not as much.
Definition at line 57 of file ChiSquareNoncentralGamGen.java.
| umontreal.ssj.randvar.ChiSquareNoncentralGamGen.ChiSquareNoncentralGamGen | ( | RandomStream | stream, |
| double | nu, | ||
| double | lambda ) |
Creates a noncentral chi square random variate generator with with.
\(\nu= \) nu degrees of freedom and noncentrality parameter \(\lambda= \) lambda using stream stream, as described above.
Definition at line 66 of file ChiSquareNoncentralGamGen.java.
| double umontreal.ssj.randvar.ChiSquareNoncentralGamGen.nextDouble | ( | ) |
Generates a random number from the continuous distribution contained in this object.
By default, this method uses inversion by calling the umontreal.ssj.probdist.ContinuousDistribution.inverseF method of the distribution object. Alternative generating methods are provided in subclasses.
Reimplemented from umontreal.ssj.randvar.RandomVariateGen.
Definition at line 72 of file ChiSquareNoncentralGamGen.java.
|
static |
Generates a variate from the noncentral chi square distribution with parameters \(\nu= \) nu and \(\lambda= \) lambda using stream stream, as described above.
Reimplemented from umontreal.ssj.randvar.ChiSquareNoncentralGen.
Definition at line 81 of file ChiSquareNoncentralGamGen.java.