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 doubleThe alpha parameter.protected final UniformRandomProviderUnderlying source of randomness.protected final doubleThe theta parameter. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateBaseGammaSampler(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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.commons.rng.sampling.distribution.ContinuousSampler
sample, samples, samplesMethods 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 <= 0ortheta <= 0
-
BaseGammaSampler
- 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.
-
-
Method Details