public abstract class AbstractRealDistribution extends Object implements RealDistribution, Serializable
| Modifier and Type | Field and Description |
|---|---|
protected RandomGenerator |
random
RNG instance used to generate samples from the distribution.
|
static double |
SOLVER_DEFAULT_ABSOLUTE_ACCURACY
Default accuracy.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractRealDistribution(RandomGenerator rng) |
| Modifier and Type | Method and Description |
|---|---|
protected double |
getSolverAbsoluteAccuracy()
Returns the solver absolute accuracy for inverse cumulative computation.
|
double |
inverseCumulativeProbability(double p)
The default implementation returns
RealDistribution.getSupportLowerBound() for p = 0,
RealDistribution.getSupportUpperBound() for p = 1. |
double |
probability(double x)
For a random variable
X whose values are distributed according
to this distribution, this method returns P(X = x). |
double |
probability(double x0,
double x1)
For a random variable
X whose values are distributed according
to this distribution, this method returns P(x0 < X <= x1). |
void |
reseedRandomGenerator(long seed)
Reseed the random generator used to generate samples.
|
double |
sample()
Generate a random value sampled from this distribution.
|
double[] |
sample(int sampleSize)
Generate a random sample from the distribution.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcumulativeProbability, density, getNumericalMean, getNumericalVariance, getSupportLowerBound, getSupportUpperBound, isSupportConnectedpublic static final double SOLVER_DEFAULT_ABSOLUTE_ACCURACY
protected final RandomGenerator random
protected AbstractRealDistribution(RandomGenerator rng)
rng - Random number generator.public double probability(double x0,
double x1)
X whose values are distributed according
to this distribution, this method returns P(x0 < X <= x1).probability in interface RealDistributionx0 - Lower bound (excluded).x1 - Upper bound (included).x0 and x1, excluding the lower
and including the upper endpoint.NumberIsTooLargeException - if x0 > x1.
The default implementation uses the identity P(x0 < X <= x1) = P(X <= x1) - P(X <= x0)public double inverseCumulativeProbability(double p)
RealDistribution.getSupportLowerBound() for p = 0,RealDistribution.getSupportUpperBound() for p = 1.inverseCumulativeProbability in interface RealDistributionp - the cumulative probabilityp-quantile of this distribution
(largest 0-quantile for p = 0)protected double getSolverAbsoluteAccuracy()
public void reseedRandomGenerator(long seed)
reseedRandomGenerator in interface RealDistributionseed - the new seedpublic double sample()
sample in interface RealDistributionpublic double[] sample(int sampleSize)
sample() in a loop.sample in interface RealDistributionsampleSize - the number of random values to generatepublic double probability(double x)
X whose values are distributed according
to this distribution, this method returns P(X = x). In other
words, this method represents the probability mass function (PMF)
for the distribution.probability in interface RealDistributionx - the point at which the PMF is evaluatedCopyright © 2025 CNES. All rights reserved.