public class ExponentialDistribution extends AbstractDistribution implements ExponentialFamily
The exponential distribution may be viewed as a continuous counterpart of the geometric distribution, which describes the number of Bernoulli trials necessary for a discrete process to change state. In contrast, the exponential distribution describes the time for a continuous process to change state.
The probability density function of an exponential distribution is f(x; λ) = λe-λx for x ≥ 0. The cumulative distribution function is given by F(x; λ) = 1 - e-λ x for x ≥ 0. An important property of the exponential distribution is that it is memoryless. This means that if a random variable T is exponentially distributed, its conditional probability obeys Pr(T > s + t | T > s) = Pr(T > t) for all s, t ≥ 0.
In queuing theory, the service times of agents in a system are often modeled as exponentially distributed variables. Reliability theory and reliability engineering also make extensive use of the exponential distribution. Because of the memoryless property of this distribution, it is well-suited to model the constant hazard rate portion of the bathtub curve used in reliability theory. The exponential distribution is however not appropriate to model the overall lifetime of organisms or technical devices, because the "failure rates" here are not constant: more failures occur for very young and for very old systems.
| Constructor and Description |
|---|
ExponentialDistribution(double lambda)
Constructor.
|
ExponentialDistribution(double[] data)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
double |
cdf(double x)
Cumulative distribution function.
|
double |
entropy()
Shannon entropy of the distribution.
|
double |
getLambda()
Returns the rate parameter.
|
double |
logp(double x)
The density at x in log scale, which may prevents the underflow problem.
|
Mixture.Component |
M(double[] x,
double[] posteriori)
The M step in the EM algorithm, which depends the specific distribution.
|
double |
mean()
The mean of distribution.
|
int |
npara()
The number of parameters of the distribution.
|
double |
p(double x)
The probability density function for continuous distribution
or probability mass function for discrete distribution at x.
|
double |
quantile(double p)
The quantile, the probability to the left of quantile is p.
|
double |
rand()
Generates a random number following this distribution.
|
double |
sd()
The standard deviation of distribution.
|
java.lang.String |
toString() |
double |
var()
The variance of distribution.
|
inverseTransformSampling, likelihood, logLikelihood, quantile, quantile, rejectionpublic ExponentialDistribution(double lambda)
lambda - rate parameter.public ExponentialDistribution(double[] data)
public double getLambda()
public int npara()
Distributionnpara in interface Distributionpublic double mean()
Distributionmean in interface Distributionpublic double var()
Distributionvar in interface Distributionpublic double sd()
Distributionsd in interface Distributionpublic double entropy()
Distributionentropy in interface Distributionpublic java.lang.String toString()
toString in class java.lang.Objectpublic double rand()
Distributionrand in interface Distributionpublic double p(double x)
Distributionp in interface Distributionpublic double logp(double x)
Distributionlogp in interface Distributionpublic double cdf(double x)
Distributioncdf in interface Distributionpublic double quantile(double p)
Distributionquantile in interface Distributionpublic Mixture.Component M(double[] x, double[] posteriori)
ExponentialFamilyM in interface ExponentialFamilyx - the input data for estimationposteriori - the posteriori probability.