org.apache.commons.math.distribution
Interface Distribution

All Known Subinterfaces:
BinomialDistribution, ChiSquaredDistribution, ContinuousDistribution, DiscreteDistribution, ExponentialDistribution, FDistribution, GammaDistribution, HypergeometricDistribution, IntegerDistribution, NormalDistribution, PoissonDistribution, TDistribution
All Known Implementing Classes:
AbstractContinuousDistribution, AbstractDistribution, AbstractIntegerDistribution, BinomialDistributionImpl, ChiSquaredDistributionImpl, ExponentialDistributionImpl, FDistributionImpl, GammaDistributionImpl, HypergeometricDistributionImpl, NormalDistributionImpl, PoissonDistributionImpl, TDistributionImpl

public interface Distribution

Base interface for probability distributions.

Version:
$Revision: 1.2 $ $Date: 2004/11/07 20:39:15 $

Method Summary
 double cumulativeProbability(double x)
          For a random variable X whose values are distributed according to this distribution, this method returns P(X ≤ x).
 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).
 

Method Detail

cumulativeProbability

public double cumulativeProbability(double x)
                             throws MathException
For a random variable X whose values are distributed according to this distribution, this method returns P(X ≤ x). In other words, this method represents the (cumulative) distribution function, or CDF, for this distribution.

Parameters:
x - the value at which the distribution function is evaluated.
Returns:
the probability that a random variable with this distribution takes a value less than or equal to x
Throws:
MathException - if the cumulative probability can not be computed due to convergence or other numerical errors.

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).

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.