Package org.hipparchus.random
Class GammaGenerator
java.lang.Object
org.hipparchus.random.AbstractNonUniformGenerator
org.hipparchus.random.GammaGenerator
- All Implemented Interfaces:
NonUniformGenerator
Procedure to generate variates for gamma distribution.
The method used for generation is based on Marsaglia and Tsang 2000 paper A Simple Method for Generating Gamma Variables
-
Constructor Summary
ConstructorsConstructorDescriptionGammaGenerator(RandomGenerator random, double alpha, double theta) Simple constructor. -
Method Summary
Methods inherited from class org.hipparchus.random.AbstractNonUniformGenerator
nextNormal, nextUniform
-
Constructor Details
-
GammaGenerator
Simple constructor.- Parameters:
random- underlying random generatoralpha- shape parametertheta- scale parameter (this is the inverse of the rate parameter λ)
-
-
Method Details
-
nextVariate
public double nextVariate()Generate next variate.- Returns:
- next variate
-