public abstract class AbstractRealDistribution extends Object implements RealDistribution, Serializable
| Modifier and Type | Field and Description |
|---|---|
protected RandomDataImpl |
randomData
RandomData instance used to generate samples from the distribution.
|
static double |
SOLVER_DEFAULT_ABSOLUTE_ACCURACY
Default accuracy.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractRealDistribution()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
double |
cumulativeProbability(double x0,
double x1)
For a random variable
X whose values are distributed according
to this distribution, this method returns P(x0 < X <= x1). |
protected double |
getSolverAbsoluteAccuracy()
Returns the solver absolute accuracy for inverse cumulative computation.
|
double |
inverseCumulativeProbability(double p)
Computes the quantile function of this distribution.
|
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, isSupportConnected, isSupportLowerBoundInclusive, isSupportUpperBoundInclusive, probabilitypublic static final double SOLVER_DEFAULT_ABSOLUTE_ACCURACY
protected final RandomDataImpl randomData
protected AbstractRealDistribution()
public double cumulativeProbability(double x0,
double x1)
throws NumberIsTooLargeException
X whose values are distributed according
to this distribution, this method returns P(x0 < X <= x1).
The default implementation uses the identity
P(x0 < X <= x1) = P(X <= x1) - P(X <= x0)
cumulativeProbability in interface RealDistributionx0 - the exclusive lower boundx1 - the inclusive upper boundx0 and x1,
excluding the lower and including the upper endpointNumberIsTooLargeException - if x0 > x1public double inverseCumulativeProbability(double p)
throws OutOfRangeException
X distributed according to this distribution, the
returned value is
inf{x in R | P(X<=x) >= p} for 0 < p <= 1,inf{x in R | P(X<=x) > 0} for p = 0.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)OutOfRangeException - if p < 0 or p > 1protected 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 generateCopyright © 2003-2012 The Apache Software Foundation. All Rights Reserved.