Class StableSampler.TransformedStableSampler
- java.lang.Object
-
- org.apache.commons.rng.sampling.distribution.StableSampler
-
- org.apache.commons.rng.sampling.distribution.StableSampler.TransformedStableSampler
-
- All Implemented Interfaces:
ContinuousSampler,SharedStateContinuousSampler,SharedStateSampler<SharedStateContinuousSampler>
- Enclosing class:
- StableSampler
private static final class StableSampler.TransformedStableSampler extends StableSampler
Class for implementations of a stable distribution transformed by scale and location.
-
-
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 Modifier and Type Field Description private doubledeltaThe location parameter.private doublegammaThe scale parameter.private StableSamplersamplerUnderlying normalized stable sampler.
-
Constructor Summary
Constructors Constructor Description TransformedStableSampler(StableSampler sampler, double gamma, double delta)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublesample()Generate a sample from a stable distribution.java.lang.StringtoString()StableSamplerwithUniformRandomProvider(UniformRandomProvider rng)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
nextLong, of, of
-
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 Detail
-
sampler
private final StableSampler sampler
Underlying normalized stable sampler.
-
gamma
private final double gamma
The scale parameter.
-
delta
private final double delta
The location parameter.
-
-
Constructor Detail
-
TransformedStableSampler
TransformedStableSampler(StableSampler sampler, double gamma, double delta)
- Parameters:
sampler- Normalized stable sampler.gamma- Scale parameter. Must be strictly positive.delta- Location parameter.
-
-
Method Detail
-
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
public StableSampler withUniformRandomProvider(UniformRandomProvider rng)
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
-
toString
public java.lang.String toString()
Description copied from class:StableSampler- Overrides:
toStringin classStableSampler
-
-