|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.math.distribution.AbstractDistribution
org.apache.commons.math.distribution.AbstractContinuousDistribution
public abstract class AbstractContinuousDistribution
Base class for continuous distributions. 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 |
static double |
SOLVER_DEFAULT_ABSOLUTE_ACCURACY
Default accuracy. |
| Constructor Summary | |
|---|---|
protected |
AbstractContinuousDistribution()
Default constructor. |
| Method Summary | |
|---|---|
abstract double |
density(double x)
Probability density for a particular point. |
protected abstract double |
getDomainLowerBound(double p)
Access the domain value lower bound, based on p, used to
bracket a CDF root. |
protected abstract double |
getDomainUpperBound(double p)
Access the domain value upper bound, based on p, used to
bracket a CDF root. |
protected abstract double |
getInitialDomain(double p)
Access the initial domain value, based on p, used to
bracket a CDF root. |
protected double |
getSolverAbsoluteAccuracy()
Returns the solver absolute accuracy for inverse cumulative computation. |
abstract double |
getSupportLowerBound()
Access the lower bound of the support. |
abstract double |
getSupportUpperBound()
Access the upper bound of the support. |
double |
inverseCumulativeProbability(double p)
For this distribution, X, this method returns the critical
point x, such that P(X < x) = p. |
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 org.apache.commons.math.distribution.AbstractDistribution |
|---|
calculateNumericalMean, calculateNumericalVariance, cumulativeProbability, getNumericalMean, getNumericalVariance, isSupportConnected, isSupportLowerBoundInclusive, isSupportUpperBoundInclusive |
| 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.math.distribution.Distribution |
|---|
cumulativeProbability, cumulativeProbability, getNumericalMean, getNumericalVariance, isSupportConnected, isSupportLowerBoundInclusive, isSupportUpperBoundInclusive |
| Field Detail |
|---|
public static final double SOLVER_DEFAULT_ABSOLUTE_ACCURACY
protected final RandomDataImpl randomData
| Constructor Detail |
|---|
protected AbstractContinuousDistribution()
| Method Detail |
|---|
public abstract double density(double x)
density in interface ContinuousDistributionx - Point at which the density should be computed.
x.public double inverseCumulativeProbability(double p)
X, this method returns the critical
point x, such that P(X < x) = p.
inverseCumulativeProbability in interface ContinuousDistributionp - Desired probability.
x, such that P(X < x) = p.
OutOfRangeException - if p is not a valid probability.public void reseedRandomGenerator(long seed)
reseedRandomGenerator in interface ContinuousDistributionseed - New seed.public double sample()
sample in interface ContinuousDistributionpublic double[] sample(int sampleSize)
sample() in a loop.
sample in interface ContinuousDistributionsampleSize - Number of random values to generate.
NotStrictlyPositiveException - if sampleSize is not positive.protected abstract double getInitialDomain(double p)
p, used to
bracket a CDF root. This method is used by
inverseCumulativeProbability(double) to find critical values.
p - Desired probability for the critical value.
protected abstract double getDomainLowerBound(double p)
p, used to
bracket a CDF root. This method is used by
inverseCumulativeProbability(double) to find critical values.
p - Desired probability for the critical value.
P(X < 'lower bound') < p.protected abstract double getDomainUpperBound(double p)
p, used to
bracket a CDF root. This method is used by
inverseCumulativeProbability(double) to find critical values.
p - Desired probability for the critical value.
P(X < 'upper bound') > p.protected double getSolverAbsoluteAccuracy()
public abstract double getSupportLowerBound()
public abstract double getSupportUpperBound()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||