|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math3.distribution.AbstractRealDistribution
public abstract class AbstractRealDistribution
Base class for probability distributions on the reals. Default implementations are provided for some of the methods that do not vary from distribution to distribution.
Field Summary | |
---|---|
protected RandomDataImpl |
randomData
RandomData instance used to generate samples from the distribution. |
private static long |
serialVersionUID
Serializable version identifier |
static double |
SOLVER_DEFAULT_ABSOLUTE_ACCURACY
Default accuracy. |
private double |
solverAbsoluteAccuracy
Solver absolute accuracy for inverse cumulative computation |
Constructor Summary | |
---|---|
protected |
AbstractRealDistribution()
Default constructor. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.commons.math3.distribution.RealDistribution |
---|
cumulativeProbability, density, getNumericalMean, getNumericalVariance, getSupportLowerBound, getSupportUpperBound, isSupportConnected, isSupportLowerBoundInclusive, isSupportUpperBoundInclusive, probability |
Field Detail |
---|
public static final double SOLVER_DEFAULT_ABSOLUTE_ACCURACY
private static final long serialVersionUID
protected final RandomDataImpl randomData
private double solverAbsoluteAccuracy
Constructor Detail |
---|
protected AbstractRealDistribution()
Method Detail |
---|
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 RealDistribution
x0
- the exclusive lower boundx1
- the inclusive upper bound
x0
and x1
,
excluding the lower and including the upper endpoint
NumberIsTooLargeException
- if x0 > x1
public 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 RealDistribution
p
- the cumulative probability
p
-quantile of this distribution
(largest 0-quantile for p = 0
)
OutOfRangeException
- if p < 0
or p > 1
protected double getSolverAbsoluteAccuracy()
public void reseedRandomGenerator(long seed)
reseedRandomGenerator
in interface RealDistribution
seed
- the new seedpublic double sample()
sample
in interface RealDistribution
public double[] sample(int sampleSize)
sample()
in a loop.
sample
in interface RealDistribution
sampleSize
- the number of random values to generate
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |