org.apache.commons.math.distribution
Interface IntegerDistribution

All Superinterfaces:
DiscreteDistribution, Distribution
All Known Subinterfaces:
BinomialDistribution, HypergeometricDistribution, PoissonDistribution
All Known Implementing Classes:
AbstractIntegerDistribution, BinomialDistributionImpl, HypergeometricDistributionImpl, PoissonDistributionImpl

public interface IntegerDistribution
extends DiscreteDistribution

Interface for discrete distributions of integer-valued random variables.

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

Method Summary
 double cumulativeProbability(int x)
          For a random variable X whose values are distributed according to this distribution, this method returns P(X ≤ x).
 double cumulativeProbability(int x0, int x1)
          For this distribution, X, this method returns P(x0 ≤ X ≤ x1).
 int inverseCumulativeProbability(double p)
          For this distribution, X, this method returns the largest x such that P(X ≤ x) <= p.
 double probability(int x)
          For a random variable X whose values are distributed according to this distribution, this method returns P(X = x).
 
Methods inherited from interface org.apache.commons.math.distribution.DiscreteDistribution
probability
 
Methods inherited from interface org.apache.commons.math.distribution.Distribution
cumulativeProbability, cumulativeProbability
 

Method Detail

probability

public double probability(int x)
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 probability mass function for the distribution.

Parameters:
x - the value at which the probability density function is evaluated.
Returns:
the value of the probability density function at x

cumulativeProbability

public double cumulativeProbability(int 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 probability distribution function, or PDF for the distribution.

Parameters:
x - the value at which the PDF is evaluated.
Returns:
PDF for this distribution.
Throws:
MathException - if the cumulative probability can not be computed due to convergence or other numerical errors.

cumulativeProbability

public double cumulativeProbability(int x0,
                                    int x1)
                             throws MathException
For this distribution, X, this method returns P(x0 ≤ X ≤ x1).

Parameters:
x0 - the inclusive, lower bound
x1 - the inclusive, upper bound
Returns:
the cumulative probability.
Throws:
MathException - if the cumulative probability can not be computed due to convergence or other numerical errors.
IllegalArgumentException - if x0 > x1

inverseCumulativeProbability

public int inverseCumulativeProbability(double p)
                                 throws MathException
For this distribution, X, this method returns the largest x such that P(X ≤ x) <= p.

Note that this definition implies:

Parameters:
p - the cumulative probability.
Returns:
the largest x such that P(X ≤ x) <= p
Throws:
MathException - if the inverse cumulative probability can not be computed due to convergence or other numerical errors.
IllegalArgumentException - if p is not between 0 and 1 (inclusive)


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