This class implements noncentral chi square random variate generators using Poisson and central chi square generators. More...
Public Member Functions | |
| ChiSquareNoncentralPoisGen (RandomStream stream, double nu, double lambda) | |
| Creates a noncentral chi square random variate generator 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 Poisson and central chi square generators.
It uses the following algorithm: generate a random integer \(J \sim\mbox{Poisson}(\lambda/2)\) from a Poisson distribution, generate a random real \(X \sim\Gamma(j + \nu/2, 1/2)\) from a gamma distribution, then return \(X\). Here \(\nu\) is the number of degrees of freedom and \(\lambda\) is the noncentrality parameter.
To generate the Poisson variates, one uses tabulated inversion for
\(\lambda<10\), and the acceptance complement method for \(\lambda\ge10\), as in [3] (see class umontreal.ssj.randvar.PoissonTIACGen ). 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 ).
<div class="SSJ-bigskip"></div>
Definition at line 53 of file ChiSquareNoncentralPoisGen.java.
| umontreal.ssj.randvar.ChiSquareNoncentralPoisGen.ChiSquareNoncentralPoisGen | ( | RandomStream | stream, |
| double | nu, | ||
| double | lambda ) |
Creates a noncentral chi square random variate generator with.
\(\nu= \) nu degrees of freedom, and noncentrality parameter \(\lambda= \) lambda, using stream stream as described above. Restriction: \(\lambda\le4.29\times10^9\).
Definition at line 62 of file ChiSquareNoncentralPoisGen.java.
| double umontreal.ssj.randvar.ChiSquareNoncentralPoisGen.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 69 of file ChiSquareNoncentralPoisGen.java.
|
static |
Generates a variate from the noncentral chi square distribution with parameters \(\nu= \) nu, and \(\lambda= \) lambda, using stream stream as described above.
Restriction: \(\lambda\le4.29\times10^9\).
Reimplemented from umontreal.ssj.randvar.ChiSquareNoncentralGen.
Definition at line 79 of file ChiSquareNoncentralPoisGen.java.