Class StableSampler.Beta0CMSStableSampler
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.Beta0WeronStableSampler
org.apache.commons.rng.sampling.distribution.StableSampler.Beta0CMSStableSampler
- All Implemented Interfaces:
ContinuousSampler, SharedStateContinuousSampler, SharedStateSampler<SharedStateContinuousSampler>
- Enclosing class:
StableSampler
Implement the generic stable distribution case:
alpha < 2 and beta == 0.
Implements the same algorithm as the StableSampler.CMSStableSampler with
the beta assumed to be 0.
This routine assumes alpha != 1; alpha=1, beta=0 is the Cauchy
distribution case.
- Since:
- 1.4
-
Nested Class Summary
Nested classes/interfaces inherited from class StableSampler
StableSampler.Alpha1CMSStableSampler, StableSampler.Beta0CMSStableSampler, StableSampler.Beta0WeronStableSampler, StableSampler.CMSStableSampler, StableSampler.SpecialMath, StableSampler.WeronStableSampler -
Field Summary
Fields inherited from class StableSampler.Beta0WeronStableSampler
eps, epsDiv1mEps, inv1mEps, meps1 -
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 StableSampler.Beta0WeronStableSampler
createSampleMethods inherited from class StableSampler.BaseStableSampler
getOmega, getPhi, getPhiBy2Methods inherited from class StableSampler
nextLong, of, of, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ContinuousSampler
samples, samples
-
Constructor Details
-
Beta0CMSStableSampler
Beta0CMSStableSampler(UniformRandomProvider rng, double alpha) - Parameters:
rng- Underlying source of randomnessalpha- Stability parameter. Must be in the interval(0, 2].
-
Beta0CMSStableSampler
Beta0CMSStableSampler(UniformRandomProvider rng, StableSampler.Beta0CMSStableSampler 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- Overrides:
samplein classStableSampler.Beta0WeronStableSampler- 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>- Overrides:
withUniformRandomProviderin classStableSampler.Beta0WeronStableSampler- Parameters:
rng- Generator of uniformly distributed random numbers.- Returns:
- the sampler
-