Class StableSampler.Alpha1CMSStableSampler
java.lang.Object
org.apache.commons.rng.sampling.distribution.StableSampler
org.apache.commons.rng.sampling.distribution.StableSampler.BaseStableSampler
org.apache.commons.rng.sampling.distribution.StableSampler.Alpha1CMSStableSampler
- All Implemented Interfaces:
ContinuousSampler,SharedStateContinuousSampler,SharedStateSampler<SharedStateContinuousSampler>
- Enclosing class:
StableSampler
Implement the stable distribution case:
alpha == 1 and beta != 0.
Implements the same algorithm as the StableSampler.CMSStableSampler with
the alpha assumed to be 1.
This sampler specifically requires that beta / (pi/2) != 0; otherwise
the parameters equal alpha=1, beta=0 as the Cauchy distribution case.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.commons.rng.sampling.distribution.StableSampler
StableSampler.Alpha1CMSStableSampler, StableSampler.Beta0CMSStableSampler, StableSampler.Beta0WeronStableSampler, StableSampler.CMSStableSampler, StableSampler.SpecialMath, StableSampler.WeronStableSampler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final doubleCache of expression value used in generation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublesample()Generate a sample from a stable distribution.Create a new instance of the sampler with the same underlying state using the given uniform random provider as the source of randomness.Methods inherited from class org.apache.commons.rng.sampling.distribution.StableSampler.BaseStableSampler
getOmega, getPhi, getPhiBy2Methods inherited from class org.apache.commons.rng.sampling.distribution.StableSampler
nextLong, of, of, toStringMethods 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
samples, samples
-
Field Details
-
tau
private final double tauCache of expression value used in generation.
-
-
Constructor Details
-
Alpha1CMSStableSampler
Alpha1CMSStableSampler(UniformRandomProvider rng, double beta) - Parameters:
rng- Underlying source of randomnessbeta- Skewness parameter. Must be in the interval[-1, 1].
-
Alpha1CMSStableSampler
Alpha1CMSStableSampler(UniformRandomProvider rng, StableSampler.Alpha1CMSStableSampler source) - Parameters:
rng- Underlying source of randomnesssource- Source to copy.
-
-
Method Details
-
sample
public double sample()Description copied from class:StableSamplerGenerate a sample from a stable distribution.The distribution uses the 0-parameterization: S(alpha, beta, gamma, delta; 0).
- Specified by:
samplein interfaceContinuousSampler- Specified by:
samplein classStableSampler- Returns:
- a sample.
-
withUniformRandomProvider
Description copied from class:StableSamplerCreate a new instance of the sampler with the same underlying state using the given uniform random provider as the source of randomness.- Specified by:
withUniformRandomProviderin interfaceSharedStateSampler<SharedStateContinuousSampler>- Specified by:
withUniformRandomProviderin classStableSampler- Parameters:
rng- Generator of uniformly distributed random numbers.- Returns:
- the sampler
-