Class KunduGupta2007
java.lang.Object
dev.nm.stat.random.rng.univariate.gamma.KunduGupta2007
- All Implemented Interfaces:
RandomGammaGenerator
,RandomNumberGenerator
,Seedable
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
ConstructorsConstructorDescriptionKunduGupta2007
(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
Modifier and TypeMethodDescriptiondouble
Get the next randomdouble
.void
seed
(long... seeds) Seed the random number/vector/scenario generator to produce repeatable experiments.
-
Constructor Details
-
KunduGupta2007
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 Details
-
seed
public void seed(long... seeds) Description copied from interface:Seedable
Seed the random number/vector/scenario generator to produce repeatable experiments. -
nextDouble
public double nextDouble()Description copied from interface:RandomNumberGenerator
Get the next randomdouble
.- Specified by:
nextDouble
in interfaceRandomNumberGenerator
- Returns:
- the next random number
-