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

This class implements noncentral chi square random variate generators using the additive property of the noncentral chi square distribution [115] . More...

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

Public Member Functions

 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.
 
double nextDouble ()
 
- Public Member Functions inherited from ChiSquareNoncentralGen
 ChiSquareNoncentralGen (RandomStream s, double nu, double lambda)
 Creates a noncentral chi square random variate generator with nu \(=\nu>0\) degrees of freedom and noncentrality parameter lambda \(= \lambda>0\), using stream s.
 
 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 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.
 

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.
 
- Static Public Member Functions inherited from ChiSquareNoncentralGen
static double nextDouble (RandomStream s, double nu, double lambda)
 Generates a new variate from the noncentral chi square distribution with nu = \(\nu\) degrees of freedom and noncentrality parameter lambda \(=\lambda\), using stream s.
 

Additional Inherited Members

- Protected Member Functions inherited from ChiSquareNoncentralGen
void setParams (double nu, double lambda)
 Sets the parameters \(\nu=\) nu and \(\lambda= \) lambda of this object.
 
- Protected Attributes inherited from ChiSquareNoncentralGen
double nu = -1.0
 
double lambda = -1.0
 
- Protected Attributes inherited from RandomVariateGen
RandomStream stream
 
Distribution dist
 

Detailed Description

This class implements noncentral chi square random variate generators using the additive property of the noncentral chi square distribution [115] .

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 [87]  (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.


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