|
|||||||||
PREV CLASS NEXT CLASS | All Classes | ||||||||
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.
Method Summary | |
---|---|
double |
density(double x)
Return the probability density for a particular point. |
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)
Reseeds the random generator used to generate samples. |
double |
sample()
Generates a random value sampled from this distribution. |
double[] |
sample(int sampleSize)
Generates a random sample from the distribution. |
Methods inherited from class org.apache.commons.math.distribution.AbstractDistribution |
---|
cumulativeProbability |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.commons.math.distribution.Distribution |
---|
cumulativeProbability, cumulativeProbability |
Method Detail |
---|
public double density(double x) throws MathRuntimeException
x
- The point at which the density should be computed.
MathRuntimeException
- if the specialized class hasn't implemented this functionpublic double inverseCumulativeProbability(double p) throws MathException
p
.
inverseCumulativeProbability
in interface ContinuousDistribution
p
- the desired probability
p
MathException
- if the inverse cumulative probability can not be
computed due to convergence or other numerical errors.
IllegalArgumentException
- if p
is not a valid
probability.public void reseedRandomGenerator(long seed)
seed
- the new seedpublic double sample() throws MathException
MathException
- if an error occurs generating the random valuepublic double[] sample(int sampleSize) throws MathException
sample()
in a loop.
sampleSize
- number of random values to generate
MathException
- if an error occurs generating the sample
IllegalArgumentException
- if sampleSize is not positive
|
|||||||||
PREV CLASS NEXT CLASS | All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |