|
SSJ V. 2.6.2. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object umontreal.iro.lecuyer.randvar.RandomVariateGen umontreal.iro.lecuyer.randvar.GammaGen umontreal.iro.lecuyer.randvar.GammaAcceptanceRejectionGen
public class GammaAcceptanceRejectionGen
This class implements gamma random variate generators using a method that combines acceptance-rejection with acceptance-complement. It uses acceptance-rejection for α < 1 and acceptance-complement for α >= 1.
When α is close to 0, the generated gamma variate may be numerically too small to be represented by the primitive date type double. The method nextDoubleLog can be used to generate the natural log value of a gamma variate. This allows the generation of very small gamma variates. For each gamma variate, the first uniform required is taken from the main stream and all additional uniforms (after the first rejection) are obtained from the auxiliary stream.
Constructor Summary | |
---|---|
GammaAcceptanceRejectionGen(RandomStream s,
double alpha,
double lambda)
Creates a gamma random variate generator with parameters α = alpha and λ = lambda, using stream s. |
|
GammaAcceptanceRejectionGen(RandomStream s,
GammaDist dist)
Creates a new generator object for the gamma distribution dist and stream s for both the main and auxiliary stream. |
|
GammaAcceptanceRejectionGen(RandomStream s,
RandomStream aux,
double alpha,
double lambda)
Creates a gamma random variate generator with parameters α = alpha and λ = lambda, using main stream s and auxiliary stream aux. |
|
GammaAcceptanceRejectionGen(RandomStream s,
RandomStream aux,
GammaDist dist)
Creates a new generator object for the gamma distribution dist, using main stream s and auxiliary stream aux. |
Method Summary | |
---|---|
RandomStream |
getAuxStream()
Returns the auxiliary stream associated with this object. |
double |
nextDouble()
Generates a random number from the continuous distribution contained in this object. |
static double |
nextDouble(RandomStream s,
double alpha,
double lambda)
Same as nextDouble (s, s, alpha, lambda). |
static double |
nextDouble(RandomStream s,
RandomStream aux,
double alpha,
double lambda)
Generates a new gamma variate with parameters α = alpha and λ = lambda, using main stream s and auxiliary stream aux. |
double |
nextDoubleLog()
Returns the natural log value of a new gamma variate. |
static double |
nextDoubleLog(RandomStream s,
double alpha,
double lambda)
Same as nextDoubleLog (s, s, alpha, lambda). |
static double |
nextDoubleLog(RandomStream s,
RandomStream aux,
double alpha,
double lambda)
Returns the natural log value of a new gamma variate with parameters α = alpha and λ = lambda, using main stream s and auxiliary stream aux. |
Methods inherited from class umontreal.iro.lecuyer.randvar.GammaGen |
---|
getAlpha, getLambda |
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 GammaAcceptanceRejectionGen(RandomStream s, RandomStream aux, double alpha, double lambda)
public GammaAcceptanceRejectionGen(RandomStream s, double alpha, double lambda)
public GammaAcceptanceRejectionGen(RandomStream s, RandomStream aux, GammaDist dist)
public GammaAcceptanceRejectionGen(RandomStream s, GammaDist dist)
Method Detail |
---|
public RandomStream getAuxStream()
public static double nextDouble(RandomStream s, RandomStream aux, double alpha, double lambda)
public double nextDouble()
RandomVariateGen
inverseF
method of the distribution object.
Alternative generating methods are provided in subclasses.
nextDouble
in class RandomVariateGen
public static double nextDouble(RandomStream s, double alpha, double lambda)
public double nextDoubleLog()
public static double nextDoubleLog(RandomStream s, RandomStream aux, double alpha, double lambda)
public static double nextDoubleLog(RandomStream s, double alpha, double lambda)
|
SSJ V. 2.6.2. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |