SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
umontreal.ssj.randvar.ChiSquareNoncentralGamGen Class Reference

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

Inheritance diagram for umontreal.ssj.randvar.ChiSquareNoncentralGamGen:
umontreal.ssj.randvar.ChiSquareNoncentralGen umontreal.ssj.randvar.RandomVariateGen

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.

Detailed Description

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.

Constructor & Destructor Documentation

◆ ChiSquareNoncentralGamGen()

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.

Member Function Documentation

◆ nextDouble() [1/2]

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.

Returns
the generated value

Reimplemented from umontreal.ssj.randvar.RandomVariateGen.

Definition at line 72 of file ChiSquareNoncentralGamGen.java.

◆ nextDouble() [2/2]

double umontreal.ssj.randvar.ChiSquareNoncentralGamGen.nextDouble ( RandomStream stream,
double nu,
double lambda )
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.


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