ExponentialDistribution Class 
Namespace: Accord.Statistics.Distributions.Univariate
[SerializableAttribute] public class ExponentialDistribution : UnivariateContinuousDistribution, IFittableDistribution<double, IFittingOptions>, IFittable<double, IFittingOptions>, IFittable<double>, IFittableDistribution<double>, IDistribution<double>, IDistribution, ICloneable, ISampleableDistribution<double>, IRandomNumberGenerator<double>
The ExponentialDistribution type exposes the following members.
Name  Description  

ExponentialDistribution 
Creates a new Exponential distribution with the given rate.
 
ExponentialDistribution(Double) 
Creates a new Exponential distribution with the given rate.

Name  Description  

Entropy 
Gets the entropy for this distribution.
(Overrides UnivariateContinuousDistributionEntropy.)  
Mean 
Gets the mean for this distribution.
(Overrides UnivariateContinuousDistributionMean.)  
Median 
Gets the median for this distribution.
(Overrides UnivariateContinuousDistributionMedian.)  
Mode 
Gets the mode for this distribution.
(Overrides UnivariateContinuousDistributionMode.)  
Quartiles 
Gets the Quartiles for this distribution.
(Inherited from UnivariateContinuousDistribution.)  
Rate 
Gets the distribution's rate parameter lambda (λ).
 
StandardDeviation 
Gets the Standard Deviation (the square root of
the variance) for the current distribution.
(Inherited from UnivariateContinuousDistribution.)  
Support 
Gets the support interval for this distribution.
(Overrides UnivariateContinuousDistributionSupport.)  
Variance 
Gets the variance for this distribution.
(Overrides UnivariateContinuousDistributionVariance.) 
Name  Description  

Clone 
Creates a new object that is a copy of the current instance.
(Overrides DistributionBaseClone.)  
ComplementaryDistributionFunction 
Gets the complementary cumulative distribution function
(ccdf) for this distribution evaluated at point x.
This function is also known as the Survival function.
(Inherited from UnivariateContinuousDistribution.)  
CumulativeHazardFunction 
Gets the cumulative hazard function for this
distribution evaluated at point x.
(Inherited from UnivariateContinuousDistribution.)  
DistributionFunction(Double) 
Gets the cumulative distribution function (cdf) for
this distribution evaluated at point x.
(Inherited from UnivariateContinuousDistribution.)  
DistributionFunction(Double, Double) 
Gets the cumulative distribution function (cdf) for this
distribution in the semiclosed interval (a; b] given as
P(a < X ≤ b).
(Inherited from UnivariateContinuousDistribution.)  
Equals  Determines whether the specified object is equal to the current object. (Inherited from Object.)  
Estimate(Double) 
Estimates a new Exponential distribution from a given set of observations.
 
Estimate(Double, Double) 
Estimates a new Exponential distribution from a given set of observations.
 
Finalize  Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)  
Fit(Double) 
Fits the underlying distribution to a given set of observations.
(Inherited from UnivariateContinuousDistribution.)  
Fit(Double, IFittingOptions) 
Fits the underlying distribution to a given set of observations.
(Inherited from UnivariateContinuousDistribution.)  
Fit(Double, Double) 
Fits the underlying distribution to a given set of observations.
(Inherited from UnivariateContinuousDistribution.)  
Fit(Double, Int32) 
Fits the underlying distribution to a given set of observations.
(Inherited from UnivariateContinuousDistribution.)  
Fit(Double, Double, IFittingOptions) 
Fits the underlying distribution to a given set of observations.
(Overrides UnivariateContinuousDistributionFit(Double, Double, IFittingOptions).)  
Fit(Double, Int32, IFittingOptions) 
Fits the underlying distribution to a given set of observations.
(Inherited from UnivariateContinuousDistribution.)  
Generate 
Generates a random observation from the current distribution.
(Inherited from UnivariateContinuousDistribution.)  
Generate(Random) 
Generates a random observation from the current distribution.
(Overrides UnivariateContinuousDistributionGenerate(Random).)  
Generate(Int32) 
Generates a random vector of observations from the current distribution.
(Inherited from UnivariateContinuousDistribution.)  
Generate(Int32, Double) 
Generates a random vector of observations from the current distribution.
(Inherited from UnivariateContinuousDistribution.)  
Generate(Int32, Random) 
Generates a random vector of observations from the current distribution.
(Inherited from UnivariateContinuousDistribution.)  
Generate(Int32, Double, Random) 
Generates a random vector of observations from the current distribution.
(Overrides UnivariateContinuousDistributionGenerate(Int32, Double, Random).)  
GetHashCode  Serves as the default hash function. (Inherited from Object.)  
GetRange 
Gets the distribution range within a given percentile.
(Inherited from UnivariateContinuousDistribution.)  
GetType  Gets the Type of the current instance. (Inherited from Object.)  
HazardFunction 
Gets the hazard function, also known as the failure rate or
the conditional failure density function for this distribution
evaluated at point x.
(Inherited from UnivariateContinuousDistribution.)  
InnerComplementaryDistributionFunction 
Gets the complementary cumulative distribution function
(ccdf) for this distribution evaluated at point x.
This function is also known as the Survival function.
(Inherited from UnivariateContinuousDistribution.)  
InnerDistributionFunction 
Gets the cumulative distribution function (cdf) for
this distribution evaluated at point x.
(Overrides UnivariateContinuousDistributionInnerDistributionFunction(Double).)  
InnerInverseDistributionFunction 
Gets the inverse of the cumulative distribution function (icdf) for
this distribution evaluated at probability p. This function
is also known as the Quantile function.
(Overrides UnivariateContinuousDistributionInnerInverseDistributionFunction(Double).)  
InnerLogProbabilityDensityFunction 
Gets the logprobability density function (pdf) for
this distribution evaluated at point x.
(Overrides UnivariateContinuousDistributionInnerLogProbabilityDensityFunction(Double).)  
InnerProbabilityDensityFunction 
Gets the probability density function (pdf) for
this distribution evaluated at point x.
(Overrides UnivariateContinuousDistributionInnerProbabilityDensityFunction(Double).)  
InverseDistributionFunction 
Gets the inverse of the cumulative distribution function (icdf) for
this distribution evaluated at probability p. This function
is also known as the Quantile function.
(Inherited from UnivariateContinuousDistribution.)  
LogCumulativeHazardFunction 
Gets the log of the cumulative hazard function for this
distribution evaluated at point x.
(Inherited from UnivariateContinuousDistribution.)  
LogProbabilityDensityFunction 
Gets the logprobability density function (pdf) for
this distribution evaluated at point x.
(Inherited from UnivariateContinuousDistribution.)  
MemberwiseClone  Creates a shallow copy of the current Object. (Inherited from Object.)  
ProbabilityDensityFunction 
Gets the probability density function (pdf) for
this distribution evaluated at point x.
(Inherited from UnivariateContinuousDistribution.)  
QuantileDensityFunction 
Gets the first derivative of the
inverse distribution function (icdf) for this distribution evaluated
at probability p.
(Inherited from UnivariateContinuousDistribution.)  
Random(Double) 
Generates a random observation from the
Exponential distribution with the given parameters.
 
Random(Double, Int32) 
Generates a random vector of observations from the
Exponential distribution with the given parameters.
 
Random(Double, Random) 
Generates a random observation from the
Exponential distribution with the given parameters.
 
Random(Double, Int32, Double) 
Generates a random vector of observations from the
Exponential distribution with the given parameters.
 
Random(Double, Int32, Random) 
Generates a random vector of observations from the
Exponential distribution with the given parameters.
 
Random(Double, Int32, Double, Random) 
Generates a random vector of observations from the
Exponential distribution with the given parameters.
 
ToString 
Returns a String that represents this instance.
(Inherited from DistributionBase.)  
ToString(IFormatProvider) 
Returns a String that represents this instance.
(Inherited from DistributionBase.)  
ToString(String) 
Returns a String that represents this instance.
(Inherited from DistributionBase.)  
ToString(String, IFormatProvider) 
Returns a String that represents this instance.
(Overrides DistributionBaseToString(String, IFormatProvider).) 
Name  Description  

HasMethod 
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.)  
IsEqual 
Compares two objects for equality, performing an elementwise
comparison if the elements are vectors or matrices.
(Defined by Matrix.)  
To(Type)  Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)  
ToT  Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.) 
In probability theory and statistics, the exponential distribution (a.k.a. negative exponential distribution) is a family of continuous probability distributions. It describes the time between events in a Poisson process, i.e. a process in which events occur continuously and independently at a constant average rate. It is the continuous analogue of the geometric distribution.
Note that the exponential distribution is not the same as the class of exponential families of distributions, which is a large class of probability distributions that includes the exponential distribution as one of its members, but also includes the normal distribution, binomial distribution, gamma distribution, Poisson, and many others.
References:
The following example shows how to create and test the main characteristics of an Exponential distribution given a lambda (λ) rate of 0.42:
// Create an Exponential distribution with λ = 0.42 var exp = new ExponentialDistribution(rate: 0.42); // Common measures double mean = exp.Mean; // 2.3809523809523809 double median = exp.Median; // 1.6503504299046317 double var = exp.Variance; // 5.6689342403628125 // Cumulative distribution functions double cdf = exp.DistributionFunction(x: 0.27); // 0.10720652870550407 double ccdf = exp.ComplementaryDistributionFunction(x: 0.27); // 0.89279347129449593 double icdf = exp.InverseDistributionFunction(p: cdf); // 0.27 // Probability density functions double pdf = exp.ProbabilityDensityFunction(x: 0.27); // 0.3749732579436883 double lpdf = exp.LogProbabilityDensityFunction(x: 0.27); // 0.98090056770472311 // Hazard (failure rate) functions double hf = exp.HazardFunction(x: 0.27); // 0.42 double chf = exp.CumulativeHazardFunction(x: 0.27); // 0.1134 // String representation string str = exp.ToString(CultureInfo.InvariantCulture); // Exp(x; λ = 0.42)
The following example shows how to generate random samples drawn from an Exponential distribution and later how to reestimate a distribution from the generated samples.
// Create an Exponential distribution with λ = 2.5 var exp = new ExponentialDistribution(rate: 2.5); // Generate a million samples from this distribution: double[] samples = target.Generate(1000000); // Create a default exponential distribution var newExp = new ExponentialDistribution(); // Fit the samples newExp.Fit(samples); // Check the estimated parameters double rate = newExp.Rate; // 2.5