org.apache.commons.math.distribution
Class AbstractDiscreteDistribution

java.lang.Object
  extended byorg.apache.commons.math.distribution.AbstractDiscreteDistribution
All Implemented Interfaces:
DiscreteDistribution
Direct Known Subclasses:
BinomialDistributionImpl, HypergeometricDistributionImpl

public abstract class AbstractDiscreteDistribution
extends Object
implements DiscreteDistribution

Base class for various discrete distributions. It provides default implementations for some of the methods that do not vary from distribution to distribution.

Version:
$Revision: 1.8 $ $Date: 2003/11/19 03:22:53 $

Constructor Summary
protected AbstractDiscreteDistribution()
          Default constructor.
 
Method Summary
 double cummulativeProbability(int x0, int x1)
          For this disbution, X, this method returns P(x0 ≤ X ≤ x1).
protected abstract  int getDomainLowerBound(double p)
          Access the domain value lower bound, based on p, used to bracket a PDF root.
protected abstract  int getDomainUpperBound(double p)
          Access the domain value upper bound, based on p, used to bracket a PDF root.
 int inverseCummulativeProbability(double p)
          For this distribution, X, this method returns the critical point x, such that P(X ≤ x) ≤ p.
 
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.DiscreteDistribution
cummulativeProbability, probability
 

Constructor Detail

AbstractDiscreteDistribution

protected AbstractDiscreteDistribution()
Default constructor.

Method Detail

cummulativeProbability

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

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

inverseCummulativeProbability

public int 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 DiscreteDistribution
Parameters:
p - the desired probability
Returns:
x, such that P(X < x) = p
Throws:
MathException

getDomainLowerBound

protected abstract int getDomainLowerBound(double p)
Access the domain value lower bound, based on p, used to bracket a PDF root. This method is used by inverseCummulativeProbability(double) to find critical values.

Parameters:
p - the desired probability for the critical value
Returns:
domain value lower bound, i.e. P(X < lower bound) < p

getDomainUpperBound

protected abstract int getDomainUpperBound(double p)
Access the domain value upper bound, based on p, used to bracket a PDF root. This method is used by inverseCummulativeProbability(double) to find critical values.

Parameters:
p - the desired probability for the critical value
Returns:
domain value upper bound, i.e. P(X < upper bound) > p


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