public class ChiSquareNoncentralGamGen extends ChiSquareNoncentralGen
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 and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
getLambda, getNugetDistribution, getStream, nextArrayOfDouble, setStreampublic ChiSquareNoncentralGamGen(RandomStream stream, double nu, double lambda)
public double nextDouble()
RandomVariateGeninverseF
method of the distribution object.
Alternative generating methods are provided in subclasses.nextDouble in class RandomVariateGenpublic static double nextDouble(RandomStream stream, double nu, double lambda)
To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.