Class AhrensDieterMarsagliaTsangGammaSampler.BaseGammaSampler
- java.lang.Object
-
- org.apache.commons.rng.sampling.distribution.AhrensDieterMarsagliaTsangGammaSampler.BaseGammaSampler
-
- All Implemented Interfaces:
ContinuousSampler,SharedStateContinuousSampler,SharedStateSampler<SharedStateContinuousSampler>
- Direct Known Subclasses:
AhrensDieterMarsagliaTsangGammaSampler.AhrensDieterGammaSampler,AhrensDieterMarsagliaTsangGammaSampler.MarsagliaTsangGammaSampler
- Enclosing class:
- AhrensDieterMarsagliaTsangGammaSampler
private abstract static class AhrensDieterMarsagliaTsangGammaSampler.BaseGammaSampler extends java.lang.Object implements SharedStateContinuousSampler
Base class for a sampler from the Gamma distribution.
-
-
Field Summary
Fields Modifier and Type Field Description protected doublealphaThe alpha parameter.protected UniformRandomProviderrngUnderlying source of randomness.protected doublethetaThe theta parameter.
-
Constructor Summary
Constructors Modifier Constructor Description privateBaseGammaSampler(double alpha, double theta, UniformRandomProvider rng)(package private)BaseGammaSampler(UniformRandomProvider rng, double alpha, double theta)(package private)BaseGammaSampler(UniformRandomProvider rng, AhrensDieterMarsagliaTsangGammaSampler.BaseGammaSampler source)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.commons.rng.sampling.distribution.ContinuousSampler
sample, samples, samples
-
Methods inherited from interface org.apache.commons.rng.sampling.SharedStateSampler
withUniformRandomProvider
-
-
-
-
Field Detail
-
rng
protected final UniformRandomProvider rng
Underlying source of randomness.
-
alpha
protected final double alpha
The alpha parameter. This is a shape parameter.
-
theta
protected final double theta
The theta parameter. This is a scale parameter.
-
-
Constructor Detail
-
BaseGammaSampler
BaseGammaSampler(UniformRandomProvider rng, double alpha, double theta)
- Parameters:
rng- Generator of uniformly distributed random numbers.alpha- Alpha parameter of the distribution.theta- Theta parameter of the distribution.- Throws:
java.lang.IllegalArgumentException- ifalpha <= 0ortheta <= 0
-
BaseGammaSampler
private BaseGammaSampler(double alpha, double theta, UniformRandomProvider rng)- Parameters:
alpha- Alpha parameter of the distribution.theta- Theta parameter of the distribution.rng- Generator of uniformly distributed random numbers.
-
BaseGammaSampler
BaseGammaSampler(UniformRandomProvider rng, AhrensDieterMarsagliaTsangGammaSampler.BaseGammaSampler source)
- Parameters:
rng- Generator of uniformly distributed random numbers.source- Source to copy.
-
-