SSJ
V. 2.6.

umontreal.iro.lecuyer.randvar
Class ChiSquareNoncentralGamGen

java.lang.Object
  extended by umontreal.iro.lecuyer.randvar.RandomVariateGen
      extended by umontreal.iro.lecuyer.randvar.ChiSquareNoncentralGen
          extended by umontreal.iro.lecuyer.randvar.ChiSquareNoncentralGamGen

public class ChiSquareNoncentralGamGen
extends ChiSquareNoncentralGen

This class implements noncentral chi square random variate generators using the additive property of the noncentral chi square distribution. It uses the following algorithm: generate a real XN((λ)1/2, 1) from a normal distribution with variance 1, generate a real YΓ((ν - 1)/2, 1/2) from a gamma distribution, then return X2 + Y. Here ν is the number of degrees of freedom and λ is the noncentrality parameter.

To generate the normal variates, one uses the fast acceptance-complement ratio method in (see class NormalACRGen). To generate the gamma variates, one uses acceptance-rejection for α < 1, and acceptance-complement for α >= 1, as proposed in (see class GammaAcceptanceRejectionGen).

This noncentral chi square generator is faster than the generator ChiSquareNoncentralPoisGen . For small λ, it is nearly twice as fast. As λ increases, it is still faster but not as much.


Constructor Summary
ChiSquareNoncentralGamGen(RandomStream stream, double nu, double lambda)
          Creates a noncentral chi square random variate generator with with ν = nu degrees of freedom and noncentrality parameter λ = lambda using stream stream, as described above.
 
Method Summary
 double nextDouble()
          Generates a random number from the continuous distribution contained in this object.
static double nextDouble(RandomStream stream, double nu, double lambda)
          Generates a variate from the noncentral chi square distribution with parameters ν = nu and λ = lambda using stream stream, as described above.
 
Methods inherited from class umontreal.iro.lecuyer.randvar.ChiSquareNoncentralGen
getLambda, getNu
 
Methods inherited from class umontreal.iro.lecuyer.randvar.RandomVariateGen
getDistribution, getStream, nextArrayOfDouble, setStream, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChiSquareNoncentralGamGen

public ChiSquareNoncentralGamGen(RandomStream stream,
                                 double nu,
                                 double lambda)
Creates a noncentral chi square random variate generator with with ν = nu degrees of freedom and noncentrality parameter λ = lambda using stream stream, as described above.

Method Detail

nextDouble

public double nextDouble()
Description copied from class: RandomVariateGen
Generates a random number from the continuous distribution contained in this object. By default, this method uses inversion by calling the inverseF method of the distribution object. Alternative generating methods are provided in subclasses.

Overrides:
nextDouble in class RandomVariateGen
Returns:
the generated value

nextDouble

public static double nextDouble(RandomStream stream,
                                double nu,
                                double lambda)
Generates a variate from the noncentral chi square distribution with parameters ν = nu and λ = lambda using stream stream, as described above.


SSJ
V. 2.6.

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.