public class InverseTransformParetoSampler extends SamplerBase implements SharedStateContinuousSampler
Sampling uses UniformRandomProvider.nextDouble()
.
Constructor and Description |
---|
InverseTransformParetoSampler(UniformRandomProvider rng,
double scale,
double shape) |
Modifier and Type | Method and Description |
---|---|
static SharedStateContinuousSampler |
of(UniformRandomProvider rng,
double scale,
double shape)
Creates a new Pareto distribution sampler.
|
double |
sample()
Creates a
double sample. |
String |
toString() |
SharedStateContinuousSampler |
withUniformRandomProvider(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.
|
nextDouble, nextInt, nextInt, nextLong
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
samples, samples
public InverseTransformParetoSampler(UniformRandomProvider rng, double scale, double shape)
rng
- Generator of uniformly distributed random numbers.scale
- Scale of the distribution.shape
- Shape of the distribution.IllegalArgumentException
- if scale <= 0
or shape <= 0
public double sample()
double
sample.sample
in interface ContinuousSampler
public String toString()
toString
in class SamplerBase
public SharedStateContinuousSampler withUniformRandomProvider(UniformRandomProvider rng)
withUniformRandomProvider
in interface SharedStateSampler<SharedStateContinuousSampler>
rng
- Generator of uniformly distributed random numbers.public static SharedStateContinuousSampler of(UniformRandomProvider rng, double scale, double shape)
rng
- Generator of uniformly distributed random numbers.scale
- Scale of the distribution.shape
- Shape of the distribution.IllegalArgumentException
- if scale <= 0
or shape <= 0
Copyright © 2016–2022 The Apache Software Foundation. All rights reserved.