public class ExponentialDistribution extends GammaDistribution implements java.io.Serializable
CONTINUOUS, DISCRETE, MIXED
Constructor and Description |
---|
ExponentialDistribution()
This default constructor creates a new exponential distribution with rate 1.
|
ExponentialDistribution(double r)
This general constructor creates a new exponential distribution with a
specified rate.
|
Modifier and Type | Method and Description |
---|---|
double |
getCDF(double x)
This method defines the cumulative distribution function.
|
double |
getDensity(double x)
This method computes the probability denstiy function.
|
double |
getMoment(int n)
This method computes the moment of order n.
|
double |
getQuantile(double p)
The method computes the quantile function.
|
double |
getRate()
This method gets the rate.
|
void |
setParameters(double k,
double b)
This method sets the gamma shape and scale parameters.
|
void |
setRate(double r)
This method sets the rate parameter.
|
void |
setShape(double k)
This method sets the gamma shape parameter, which must be 1.
|
java.lang.String |
toString()
This method returns a string that gives the name of the distribution and the values of
the parameters.
|
getMaxDensity, getMean, getMGF, getMoment, getScale, getShape, getVariance, setScale, simulate
getDomain, getFailureRate, getMedian, getPGF, getSD, getType, setDomain, setDomain
public ExponentialDistribution(double r)
r
- the ratepublic ExponentialDistribution()
public void setRate(double r)
r
- the ratepublic double getRate()
public double getDensity(double x)
getDensity
in class GammaDistribution
x
- a number in the domain of the distributionpublic double getCDF(double x)
getCDF
in class GammaDistribution
x
- a number in the domain of the distributionpublic double getQuantile(double p)
getQuantile
in class Distribution
p
- a probability in (0, 1)public double getMoment(int n)
getMoment
in class GammaDistribution
n
- the orderpublic void setShape(double k)
setShape
in class GammaDistribution
k
- the shape parameterpublic void setParameters(double k, double b)
setParameters
in class GammaDistribution
k
- the shape parameterb
- the scale parameterpublic java.lang.String toString()
toString
in class GammaDistribution