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 Object
implements SharedStateContinuousSampler
Base class for a sampler from the Gamma distribution.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final double
The alpha parameter.protected final UniformRandomProvider
Underlying source of randomness.protected final double
The theta parameter. -
Constructor Summary
ConstructorsConstructorDescriptionBaseGammaSampler
(UniformRandomProvider rng, double alpha, double theta) BaseGammaSampler
(UniformRandomProvider rng, AhrensDieterMarsagliaTsangGammaSampler.BaseGammaSampler source) -
Method Summary
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 Details
-
rng
Underlying source of randomness. -
alpha
protected final double alphaThe alpha parameter. This is a shape parameter. -
theta
protected final double thetaThe theta parameter. This is a scale parameter.
-
-
Constructor Details
-
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:
IllegalArgumentException
- ifalpha <= 0
ortheta <= 0
-
BaseGammaSampler
BaseGammaSampler(UniformRandomProvider rng, AhrensDieterMarsagliaTsangGammaSampler.BaseGammaSampler source) - Parameters:
rng
- Generator of uniformly distributed random numbers.source
- Source to copy.
-
-
Method Details