umontreal.iro.lecuyer.randvar
Class GammaGen
- java.lang.Object
-
- umontreal.iro.lecuyer.randvar.RandomVariateGen
-
- umontreal.iro.lecuyer.randvar.GammaGen
-
- Direct Known Subclasses:
- ErlangGen, GammaAcceptanceRejectionGen, GammaRejectionLoglogisticGen
public class GammaGen extends RandomVariateGen
This class implements random variate generators for the gamma distribution. Its parameters are α > 0 and λ > 0. Its density function isf (x) = λαxα-1e-λx/Γ(α) for x > 0,where Γ is the gamma function defined byΓ(α) = ∫0∞xα-1e-x dx.The (non-static) nextDouble method simply calls inverseF on the distribution.
-
-
Constructor Summary
Constructors Constructor and Description GammaGen(RandomStream s, double alpha)Creates a gamma random variate generator with parameters α = alpha and λ = 1, using stream s.GammaGen(RandomStream s, double alpha, double lambda)Creates a gamma random variate generator with parameters α = alpha and λ = lambda, using stream s.GammaGen(RandomStream s, GammaDist dist)Creates a new generator object for the gamma distribution dist and stream s.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublegetAlpha()Returns the parameter α of this object.doublegetLambda()Returns the parameter λ of this object.static doublenextDouble(RandomStream s, double alpha, double lambda)Generates a new gamma random variate with parameters α = alpha and λ = lambda, using stream s.-
Methods inherited from class umontreal.iro.lecuyer.randvar.RandomVariateGen
getDistribution, getStream, nextArrayOfDouble, nextDouble, setStream, toString
-
-
-
-
Constructor Detail
-
GammaGen
public GammaGen(RandomStream s, double alpha, double lambda)
Creates a gamma random variate generator with parameters α = alpha and λ = lambda, using stream s.
-
GammaGen
public GammaGen(RandomStream s, double alpha)
Creates a gamma random variate generator with parameters α = alpha and λ = 1, using stream s.
-
GammaGen
public GammaGen(RandomStream s, GammaDist dist)
Creates a new generator object for the gamma distribution dist and stream s.
-
-
Method Detail
-
nextDouble
public static double nextDouble(RandomStream s, double alpha, double lambda)
Generates a new gamma random variate with parameters α = alpha and λ = lambda, using stream s.
-
getAlpha
public double getAlpha()
Returns the parameter α of this object.
-
getLambda
public double getLambda()
Returns the parameter λ of this object.
-
-
DMelt 3.0 © DataMelt by jWork.ORG