edu.uah.math.distributions
Class ExponentialDistribution

java.lang.Object
  extended by edu.uah.math.distributions.Distribution
      extended by edu.uah.math.distributions.GammaDistribution
          extended by edu.uah.math.distributions.ExponentialDistribution
All Implemented Interfaces:
java.io.Serializable

public class ExponentialDistribution
extends GammaDistribution
implements java.io.Serializable

This class defines the standard exponential distribution with a specified rate parameter.

Version:
August, 2003
Author:
Kyle Siegrist, Dawn Duehring
See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.uah.math.distributions.Distribution
CONTINUOUS, DISCRETE, MIXED
 
Constructor Summary
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.
 
Method Summary
 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.
 
Methods inherited from class edu.uah.math.distributions.GammaDistribution
getMaxDensity, getMean, getMGF, getMoment, getScale, getShape, getVariance, setScale, simulate
 
Methods inherited from class edu.uah.math.distributions.Distribution
getDomain, getFailureRate, getMedian, getPGF, getSD, getType, setDomain, setDomain
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExponentialDistribution

public ExponentialDistribution(double r)
This general constructor creates a new exponential distribution with a specified rate.

Parameters:
r - the rate

ExponentialDistribution

public ExponentialDistribution()
This default constructor creates a new exponential distribution with rate 1.

Method Detail

setRate

public void setRate(double r)
This method sets the rate parameter.

Parameters:
r - the rate

getRate

public double getRate()
This method gets the rate.

Returns:
the rate

getDensity

public double getDensity(double x)
This method computes the probability denstiy function.

Overrides:
getDensity in class GammaDistribution
Parameters:
x - a number in the domain of the distribution
Returns:
the probability density at x

getCDF

public double getCDF(double x)
This method defines the cumulative distribution function.

Overrides:
getCDF in class GammaDistribution
Parameters:
x - a number in the domain of the distribution
Returns:
the cumulative probability at x

getQuantile

public double getQuantile(double p)
The method computes the quantile function.

Overrides:
getQuantile in class Distribution
Parameters:
p - a probability in (0, 1)
Returns:
the quantile of order p

getMoment

public double getMoment(int n)
This method computes the moment of order n.

Overrides:
getMoment in class GammaDistribution
Parameters:
n - the order
Returns:
the moment of order n

setShape

public void setShape(double k)
This method sets the gamma shape parameter, which must be 1.

Overrides:
setShape in class GammaDistribution
Parameters:
k - the shape parameter

setParameters

public void setParameters(double k,
                          double b)
This method sets the gamma shape and scale parameters. The shape parameter must be 1.

Overrides:
setParameters in class GammaDistribution
Parameters:
k - the shape parameter
b - the scale parameter

toString

public java.lang.String toString()
This method returns a string that gives the name of the distribution and the values of the parameters.

Overrides:
toString in class GammaDistribution
Returns:
a string giving the name of the distribution and the values of the parameters