|
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
|
+--jsc.distributions.Exponential
This class represents an exponential distribution.
Note that here the distribution is defined in terms of its mean. (Some textbooks define the distribution differently in terms of a parameter that is the reciprocal of the mean.)
This could have been defined as a subclass of Gamma or Weibull with shape
parameter = 1, but not done so since calculations for exponential are so much simpler.
| Field Summary |
| Fields inherited from class jsc.distributions.AbstractDistribution |
rand |
| Constructor Summary | |
Exponential()
Create an exponential distribution with mean 1. |
|
Exponential(double mean)
Create an exponential distribution with specified mean. |
|
| Method Summary | |
double |
cdf(double x)
Returns the value of the cumulative density function at a variate-value x. |
double |
getMaximumPdf()
Returns the maximum value of the pdf of the distribution. |
double |
inverseCdf(double p)
Returns the inverse of the distribution. |
double |
mean()
Returns mean of the distribution if it exists. |
double |
pdf(double x)
Returns the value of the probability density function at variate-value x. |
double |
random()
Returns a pseudo-random variate-value from the distribution. |
double |
sd()
Returns the standard deviation of the distribution. |
void |
setMean(double mean)
Sets the mean of the distribution. |
String |
toString()
|
double |
variance()
Returns variance of the distribution if it exists. |
| Methods inherited from class jsc.distributions.AbstractDistribution |
isDiscrete, setSeed |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Exponential(double mean)
mean - the parameter (mean) of the distribution; must be greater than 0.
IllegalArgumentException - if mean less than or equal to 0.public Exponential()
| Method Detail |
public double cdf(double x)
cdf in interface Distributioncdf in class AbstractDistributionx - a variate-value; must be greater than or equal to zero.
IllegalArgumentException - if x less than 0.public double getMaximumPdf()
public double inverseCdf(double p)
inverseCdf in interface DistributioninverseCdf in class AbstractDistributionp - the value of the probability; must be in [0,1].
IllegalArgumentException - if p is less than 0 or greater than 1.public double mean()
DistributionDouble.NaN.
mean in interface Distributionmean in class AbstractDistributionpublic double pdf(double x)
pdf in interface Distributionpdf in class AbstractDistributionx - a variate-value; must be greater than or equal to zero.
IllegalArgumentException - if x less than 0.public double random()
AbstractDistribution
random in interface Distributionrandom in class AbstractDistributionpublic double sd()
sd in class AbstractDistributionpublic void setMean(double mean)
mean - the parameter (mean) of the distribution; must be greater than 0.
IllegalArgumentException - if b less than or equal to 0.public String toString()
toString in class Objectpublic double variance()
DistributionDouble.NaN.
variance in interface Distributionvariance in class AbstractDistribution
|
Java Statistical Classes | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||