org.apache.commons.math.distribution
Class ExponentialDistributionImpl

java.lang.Object
  extended byorg.apache.commons.math.distribution.ExponentialDistributionImpl
All Implemented Interfaces:
ContinuousDistribution, ExponentialDistribution, Serializable

public class ExponentialDistributionImpl
extends Object
implements ExponentialDistribution, Serializable

The default implementation of ExponentialDistribution

Version:
$Revision: 1.10 $ $Date: 2003/11/19 03:22:53 $
See Also:
Serialized Form

Constructor Summary
ExponentialDistributionImpl(double mean)
          Create a exponential distribution with the given mean.
 
Method Summary
 double cummulativeProbability(double x)
          For this disbution, X, this method returns P(X < x).
 double cummulativeProbability(double x0, double x1)
          For this disbution, X, this method returns P(x0 < X < x1).
 double getMean()
          Access the mean.
 double inverseCummulativeProbability(double p)
          For this distribution, X, this method returns the critical point x, such that P(X < x) = p.
 void setMean(double mean)
          Modify the mean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExponentialDistributionImpl

public ExponentialDistributionImpl(double mean)
Create a exponential distribution with the given mean.

Parameters:
mean - mean of this distribution.
Method Detail

setMean

public void setMean(double mean)
Modify the mean.

Specified by:
setMean in interface ExponentialDistribution
Parameters:
mean - the new mean.

getMean

public double getMean()
Access the mean.

Specified by:
getMean in interface ExponentialDistribution
Returns:
the mean.

cummulativeProbability

public double cummulativeProbability(double x)
                              throws MathException
For this disbution, X, this method returns P(X < x). The implementation of this method is based on:

Specified by:
cummulativeProbability in interface ContinuousDistribution
Parameters:
x - the value at which the CDF is evaluated.
Returns:
CDF for this distribution.
Throws:
MathException

inverseCummulativeProbability

public double inverseCummulativeProbability(double p)
                                     throws MathException
For this distribution, X, this method returns the critical point x, such that P(X < x) = p.

Specified by:
inverseCummulativeProbability in interface ContinuousDistribution
Parameters:
p - the desired probability
Returns:
x, such that P(X < x) = p
Throws:
MathException

cummulativeProbability

public double cummulativeProbability(double x0,
                                     double x1)
                              throws MathException
For this disbution, X, this method returns P(x0 < X < x1).

Specified by:
cummulativeProbability in interface ContinuousDistribution
Parameters:
x0 - the lower bound
x1 - the upper bound
Returns:
the cummulative probability.
Throws:
MathException


Copyright © 2003-2004 Apache Software Foundation. All Rights Reserved.