@PublicationReference(author="Wikipedia", title="Exponential distribution", type=WebPage, year=2009, url="http://en.wikipedia.org/wiki/Exponential_distribution") public class ExponentialDistribution extends AbstractClosedFormSmoothUnivariateDistribution implements EstimableDistribution<java.lang.Double,ExponentialDistribution>
| Modifier and Type | Class and Description |
|---|---|
static class |
ExponentialDistribution.CDF
CDF of the ExponentialDistribution.
|
static class |
ExponentialDistribution.MaximumLikelihoodEstimator
Creates a ExponentialDistribution from data
|
static class |
ExponentialDistribution.PDF
PDF of the ExponentialDistribution.
|
static class |
ExponentialDistribution.WeightedMaximumLikelihoodEstimator
Creates a ExponentialDistribution from weighted data
|
| Modifier and Type | Field and Description |
|---|---|
static double |
DEFAULT_RATE
Default rate, 1.0.
|
protected double |
rate
Rate, or inverse scale, of the distribution, must be greater than zero.
|
| Constructor and Description |
|---|
ExponentialDistribution()
Creates a new instance of ExponentialDistribution
|
ExponentialDistribution(double rate)
Creates a new instance of ExponentialDistribution
|
ExponentialDistribution(ExponentialDistribution other)
Creates a new instance of ExponentialDistribution
|
| Modifier and Type | Method and Description |
|---|---|
ExponentialDistribution |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
void |
convertFromVector(Vector parameters)
Converts the object from a Vector of parameters.
|
Vector |
convertToVector()
Converts the object to a vector.
|
ExponentialDistribution.CDF |
getCDF()
Gets the CDF of a scalar distribution.
|
ExponentialDistribution.MaximumLikelihoodEstimator |
getEstimator()
Gets an estimator associated with this distribution.
|
java.lang.Double |
getMaxSupport()
Gets the minimum support (domain or input) of the distribution.
|
double |
getMeanAsDouble()
Gets the mean of the distribution as a double.
|
java.lang.Double |
getMinSupport()
Gets the minimum support (domain or input) of the distribution.
|
ExponentialDistribution.PDF |
getProbabilityFunction()
Gets the distribution function associated with this Distribution,
either the PDF or PMF.
|
double |
getRate()
Getter for rate.
|
double |
getVariance()
Gets the variance of the distribution.
|
double |
sampleAsDouble(java.util.Random random)
Samples a value from this distribution as a double.
|
void |
sampleInto(java.util.Random random,
double[] output,
int start,
int length)
Samples values from this distribution as an array of doubles.
|
void |
setRate(double rate)
Setter for rate.
|
java.lang.String |
toString() |
getMean, sampleAsDoubles, sampleIntosample, sampleequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsample, sample, sampleIntopublic static final double DEFAULT_RATE
protected double rate
public ExponentialDistribution()
public ExponentialDistribution(double rate)
rate - Rate, or inverse scale, of the distribution, must be greater than zero.public ExponentialDistribution(ExponentialDistribution other)
other - ExponentialDistribution to copy.public ExponentialDistribution clone()
AbstractCloneableSerializableObject class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone() to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone() as the basis for your implementation.clone in interface Vectorizableclone in interface CloneableSerializableclone in class AbstractClosedFormUnivariateDistribution<java.lang.Double>public double getRate()
public void setRate(double rate)
rate - Rate, or inverse scale, of the distribution, must be greater than zero.public double getMeanAsDouble()
UnivariateDistributiongetMeanAsDouble in interface UnivariateDistribution<java.lang.Double>@PublicationReference(author={"Christian P. Robert","George Casella"}, title="Monte Carlo Statistical Methods, Second Edition", type=Book, year=2004, pages=39, notes="Example 2.5") public double sampleAsDouble(java.util.Random random)
SmoothUnivariateDistributionsampleAsDouble in interface SmoothUnivariateDistributionsampleAsDouble in class AbstractClosedFormSmoothUnivariateDistributionrandom - Random number generator to use.public void sampleInto(java.util.Random random,
double[] output,
int start,
int length)
SmoothUnivariateDistributionsampleInto in interface SmoothUnivariateDistributionrandom - Random number generator to use.output - The array to write the result into. Cannot be null.start - The offset in the array to start writing at. Cannot be negative.length - The number of values to sample. Cannot be negative.public ExponentialDistribution.CDF getCDF()
UnivariateDistributiongetCDF in interface ClosedFormUnivariateDistribution<java.lang.Double>getCDF in interface SmoothUnivariateDistributiongetCDF in interface UnivariateDistribution<java.lang.Double>public Vector convertToVector()
VectorizableconvertToVector in interface Vectorizablepublic void convertFromVector(Vector parameters)
VectorizableconvertFromVector in interface Vectorizableparameters - The parameters to incorporate.public double getVariance()
UnivariateDistributiongetVariance in interface UnivariateDistribution<java.lang.Double>public ExponentialDistribution.PDF getProbabilityFunction()
ComputableDistributiongetProbabilityFunction in interface ComputableDistribution<java.lang.Double>getProbabilityFunction in interface SmoothUnivariateDistributionpublic java.lang.Double getMinSupport()
UnivariateDistributiongetMinSupport in interface UnivariateDistribution<java.lang.Double>public java.lang.Double getMaxSupport()
UnivariateDistributiongetMaxSupport in interface UnivariateDistribution<java.lang.Double>public ExponentialDistribution.MaximumLikelihoodEstimator getEstimator()
EstimableDistributiongetEstimator in interface EstimableDistribution<java.lang.Double,ExponentialDistribution>public java.lang.String toString()
toString in class java.lang.Object