public abstract class TSampler extends Object implements SharedStateContinuousSampler
Uses Bailey's algorithm for t-distribution sampling:
Bailey, R. W. (1994) "Polar Generation of Random Variates with the t-Distribution." Mathematics of Computation 62, 779-781.
Sampling uses UniformRandomProvider.nextLong()
.
Modifier and Type | Method and Description |
---|---|
static TSampler |
of(UniformRandomProvider rng,
double degreesOfFreedom)
Create a new t distribution sampler.
|
String |
toString() |
abstract TSampler |
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
sample, samples, samples
public abstract TSampler withUniformRandomProvider(UniformRandomProvider rng)
withUniformRandomProvider
in interface SharedStateSampler<SharedStateContinuousSampler>
rng
- Generator of uniformly distributed random numbers.public static TSampler of(UniformRandomProvider rng, double degreesOfFreedom)
rng
- Generator of uniformly distributed random numbers.degreesOfFreedom
- Degrees of freedom.IllegalArgumentException
- if degreesOfFreedom <= 0
Copyright © 2016–2022 The Apache Software Foundation. All rights reserved.