|
Java Statistical Classes | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--jsc.distributions.AbstractDistribution
Root class for classes that implement the Distribution interface.
It defines a default method to return random values from the distribution,
and some other useful methods.
The constructor creates a pseudo-random number generator for use by
subclassed specific distributions - especially through Random.nextDouble()
which produces values from U(0,1) that is the basis of random number generators for all distributions.
But note that setSeed(long) should be used to avoid different instances
producing the same, or correlated, random values.
| Field Summary | |
protected Random |
rand
Pseudo-random number generator for use by subclassed specific distributions. |
| Constructor Summary | |
AbstractDistribution()
Creates a pseudo-random number generator for use by subclassed specific distributions |
|
| Method Summary | |
abstract double |
cdf(double x)
Returns the value of the cumulative density function at a variate-value x. |
abstract double |
inverseCdf(double p)
Returns the rth moment about an arbitrary point, a. |
boolean |
isDiscrete()
Returns false indicating that the distribution is continuous. |
abstract double |
mean()
Returns mean of the distribution if it exists. |
abstract double |
pdf(double x)
Returns the value of the probability density (or mass) function at a variate-value x. |
double |
random()
Returns a pseudo-random variate-value from the distribution. |
double |
sd()
Returns the standard deviation of the distribution if it exists. |
void |
setSeed(long seed)
Initialize the random number generator with a seed value. |
abstract double |
variance()
Returns variance of the distribution if it exists. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected Random rand
rand.nextDouble() produces values from U(0,1) that is the basis
of all random number generators.
| Constructor Detail |
public AbstractDistribution()
| Method Detail |
public abstract double cdf(double x)
Distribution
cdf in interface Distributionx - a valid variate-value from the distribution.
public abstract double inverseCdf(double p)
inverseCdf in interface Distributionp - the value of the probability; must be greater than or equal to
0 and less than or equal to 1. Implemented methods may be more restrictive
with respect to values close to, or equal to, 0 or 1.
public boolean isDiscrete()
isDiscrete in interface Distributionpublic abstract double mean()
DistributionDouble.NaN.
mean in interface Distributionpublic abstract double pdf(double x)
Distribution
pdf in interface Distributionx - a valid variate-value from the distribution.
public double random()
random in interface Distributionpublic double sd()
Double.NaN.
This default implementation returns the positive square root of the
variance.
public void setSeed(long seed)
setSeed in interface Distributionseed - a seed value.public abstract double variance()
DistributionDouble.NaN.
variance in interface Distribution
|
Java Statistical Classes | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||