|
SSJ V. labo. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectumontreal.iro.lecuyer.randvar.RandomVariateGen
umontreal.iro.lecuyer.randvar.ChiSquareNoncentralGen
umontreal.iro.lecuyer.randvar.ChiSquareNoncentralGamGen
public class ChiSquareNoncentralGamGen
ChiSquareNoncentralGamGen
This class implements noncentral chi square random variate generators
using the additive property of the noncentral chi square distribution[#!tKRI06a!#]. It uses the following algorithm: generate a real
X∼N(
, 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[#!rHOR90a!#] (see class umontreal.iro.lecuyer.randvarNormalACRGen). To generate the gamma variates, one uses acceptance-rejection for α < 1, and acceptance-complement for α≥1, as proposed in[#!rAHR72b!#,#!rAHR82a!#] (see class umontreal.iro.lecuyer.randvar GammaAcceptanceRejectionGen).
This noncentral chi square generator is faster than the generator umontreal.iro.lecuyer.randvarChiSquareNoncentralPoisGen . 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)
. |
|
| 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)
. |
| 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 |
|---|
public ChiSquareNoncentralGamGen(RandomStream stream,
double nu,
double lambda)
| Method Detail |
|---|
public double nextDouble()
RandomVariateGeninverseF
method of the distribution object.
Alternative generating methods are provided in subclasses.
nextDouble in class RandomVariateGen
public static double nextDouble(RandomStream stream,
double nu,
double lambda)
|
SSJ V. labo. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||