org.apache.commons.math.distribution
Class AbstractContinuousDistribution

java.lang.Object
  extended byorg.apache.commons.math.distribution.AbstractContinuousDistribution
All Implemented Interfaces:
ContinuousDistribution
Direct Known Subclasses:
ChiSquaredDistributionImpl, FDistributionImpl, GammaDistributionImpl, TDistributionImpl

public abstract class AbstractContinuousDistribution
extends Object
implements ContinuousDistribution

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

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

Constructor Summary
protected AbstractContinuousDistribution()
          Default constructor.
 
Method Summary
 double cummulativeProbability(double x0, double x1)
          For this distribution, X, this method returns P(x0 < X < x1).
protected abstract  double getDomainLowerBound(double p)
          Access the domain value lower bound, based on p, used to bracket a CDF root.
protected abstract  double getDomainUpperBound(double p)
          Access the domain value upper bound, based on p, used to bracket a CDF root.
protected abstract  double getInitialDomain(double p)
          Access the initial domain value, based on p, used to bracket a CDF root.
 double 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.ContinuousDistribution
cummulativeProbability
 

Constructor Detail

AbstractContinuousDistribution

protected AbstractContinuousDistribution()
Default constructor.

Method Detail

cummulativeProbability

public double cummulativeProbability(double x0,
                                     double x1)
                              throws MathException
For this distribution, X, this method returns P(x0 < X < x1). This is accomplished by using the equality P(x0 < X < x1) = P(X < x1) - P(X < x0).

Specified by:
cummulativeProbability in interface ContinuousDistribution
Parameters:
x0 - the lower bound
x1 - the upper bound
Returns:
the cummulative probability.
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

getInitialDomain

protected abstract double getInitialDomain(double p)
Access the initial domain value, based on p, used to bracket a CDF root. This method is used by inverseCummulativeProbability(double) to find critical values.

Parameters:
p - the desired probability for the critical value
Returns:
initial domain value

getDomainLowerBound

protected abstract double getDomainLowerBound(double p)
Access the domain value lower bound, based on p, used to bracket a CDF 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 double getDomainUpperBound(double p)
Access the domain value upper bound, based on p, used to bracket a CDF 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.