Class KunduGupta2007
- java.lang.Object
-
- dev.nm.stat.random.rng.univariate.gamma.KunduGupta2007
-
- All Implemented Interfaces:
RandomGammaGenerator,RandomNumberGenerator,Seedable
public class KunduGupta2007 extends Object implements RandomGammaGenerator
Kundu-Gupta propose a very convenient way to generate gamma random variables using generalized exponential distribution, when the shape parameter lies between 0 and 1. This implementation is Algorithm 3 in the reference.
-
-
Constructor Summary
Constructors Constructor Description KunduGupta2007(double k, double theta)Constructs a random number generator to sample from the gamma distribution.KunduGupta2007(double k, double theta, RandomLongGenerator uniform)Constructs a random number generator to sample from the gamma distribution.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublenextDouble()Get the next randomdouble.voidseed(long... seeds)Seed the random number/vector/scenario generator to produce repeatable experiments.
-
-
-
Constructor Detail
-
KunduGupta2007
public KunduGupta2007(double k, double theta, RandomLongGenerator uniform)Constructs a random number generator to sample from the gamma distribution.- Parameters:
k- the shape parametertheta- the scale parameteruniform- a uniform random number generator
-
KunduGupta2007
public KunduGupta2007(double k, double theta)Constructs a random number generator to sample from the gamma distribution.- Parameters:
k- the shape parametertheta- the scale parameter
-
-
Method Detail
-
seed
public void seed(long... seeds)
Description copied from interface:SeedableSeed the random number/vector/scenario generator to produce repeatable experiments.
-
nextDouble
public double nextDouble()
Description copied from interface:RandomNumberGeneratorGet the next randomdouble.- Specified by:
nextDoublein interfaceRandomNumberGenerator- Returns:
- the next random number
-
-