org.apache.commons.math.distribution
Class AbstractDistribution

java.lang.Object
  extended byorg.apache.commons.math.distribution.AbstractDistribution
All Implemented Interfaces:
Distribution, Serializable
Direct Known Subclasses:
AbstractContinuousDistribution, AbstractIntegerDistribution

public abstract class AbstractDistribution
extends Object
implements Distribution, Serializable

Base class for probability distributions.

Version:
$Revision: 1.2 $ $Date: 2004/11/07 20:39:15 $
See Also:
Serialized Form

Field Summary
(package private) static long serialVersionUID
          Serializable version identifier
 
Constructor Summary
protected AbstractDistribution()
          Default constructor.
 
Method Summary
 double cumulativeProbability(double x0, double x1)
          For a random variable X whose values are distributed according to this distribution, this method returns P(x0 ≤ X ≤ x1).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.commons.math.distribution.Distribution
cumulativeProbability
 

Field Detail

serialVersionUID

static final long serialVersionUID
Serializable version identifier

See Also:
Constant Field Values
Constructor Detail

AbstractDistribution

protected AbstractDistribution()
Default constructor.

Method Detail

cumulativeProbability

public double cumulativeProbability(double x0,
                                    double x1)
                             throws MathException
For a random variable X whose values are distributed according to this distribution, this method returns P(x0 ≤ X ≤ x1).

The default implementation uses the identity

P(x0 ≤ X ≤ x1) = P(X ≤ x1) - P(X ≤ x0)

Specified by:
cumulativeProbability in interface Distribution
Parameters:
x0 - the (inclusive) lower bound
x1 - the (inclusive) upper bound
Returns:
the probability that a random variable with this distribution will take a value between x0 and x1, including the endpoints.
Throws:
MathException - if the cumulative probability can not be computed due to convergence or other numerical errors.
IllegalArgumentException - if x0 > x1


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