umontreal.iro.lecuyer.randvar
Class ChiSquareNoncentralPoisGen
java.lang.Object
umontreal.iro.lecuyer.randvar.RandomVariateGen
umontreal.iro.lecuyer.randvar.ChiSquareNoncentralGen
umontreal.iro.lecuyer.randvar.ChiSquareNoncentralPoisGen
public class ChiSquareNoncentralPoisGen
- extends ChiSquareNoncentralGen
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∼Poisson(λ/2) from a Poisson
distribution, generate a random real
X∼Γ(j + ν/2, 1/2) from a
gamma distribution, then return X.
Here ν is the number of degrees of freedom and
λ is the noncentrality parameter.
To generate the Poisson variates, one
uses tabulated inversion for
λ < 10, and the acceptance complement
method for
λ >= 10, as in
(see class PoissonTIACGen
).
To generate the gamma variates, one
uses acceptance-rejection for α < 1, and acceptance-complement
for
α >= 1, as proposed in
(see class GammaAcceptanceRejectionGen
).
Constructor Summary |
ChiSquareNoncentralPoisGen(RandomStream stream,
double nu,
double lambda)
Creates a noncentral chi square random variate generator
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. |
ChiSquareNoncentralPoisGen
public ChiSquareNoncentralPoisGen(RandomStream stream,
double nu,
double lambda)
- Creates a noncentral chi square random variate generator
with ν = nu degrees of freedom and noncentrality parameter
λ = lambda using stream stream, as described above.
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.
jHepWork 3.1 ©