Class StableSampler.CauchyStableSampler
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.CauchyStableSampler
- All Implemented Interfaces:
ContinuousSampler
,SharedStateContinuousSampler
,SharedStateSampler<SharedStateContinuousSampler>
- Enclosing class:
StableSampler
private static final class StableSampler.CauchyStableSampler
extends StableSampler.BaseStableSampler
Implement the
alpha = 1
and beta = 0
stable distribution case
(Cauchy distribution).-
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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
sample()
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, getPhiBy2
Methods inherited from class org.apache.commons.rng.sampling.distribution.StableSampler
nextLong, of, of, toString
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
samples, samples
-
Field Details
-
gamma
private final double gammaThe scale parameter. -
delta
private final double deltaThe location parameter.
-
-
Constructor Details
-
CauchyStableSampler
CauchyStableSampler(UniformRandomProvider rng, double gamma, double delta) - Parameters:
rng
- Underlying source of randomnessgamma
- Scale parameter. Must be strictly positive.delta
- Location parameter.
-
CauchyStableSampler
CauchyStableSampler(UniformRandomProvider rng, StableSampler.CauchyStableSampler source) - Parameters:
rng
- Underlying source of randomnesssource
- Source to copy.
-
-
Method Details
-
sample
public double sample()Description copied from class:StableSampler
Generate a sample from a stable distribution.The distribution uses the 0-parameterization: S(alpha, beta, gamma, delta; 0).
- Specified by:
sample
in interfaceContinuousSampler
- Specified by:
sample
in classStableSampler
- Returns:
- a sample.
-
withUniformRandomProvider
Description copied from class:StableSampler
Create a new instance of the sampler with the same underlying state using the given uniform random provider as the source of randomness.- Specified by:
withUniformRandomProvider
in interfaceSharedStateSampler<SharedStateContinuousSampler>
- Specified by:
withUniformRandomProvider
in classStableSampler
- Parameters:
rng
- Generator of uniformly distributed random numbers.- Returns:
- the sampler
-