org.apache.commons.math.distribution
Interface Distribution

All Known Subinterfaces:
BetaDistribution, BinomialDistribution, CauchyDistribution, ChiSquaredDistribution, ContinuousDistribution, DiscreteDistribution, ExponentialDistribution, FDistribution, GammaDistribution, HypergeometricDistribution, IntegerDistribution, NormalDistribution, PascalDistribution, PoissonDistribution, TDistribution, WeibullDistribution, ZipfDistribution
All Known Implementing Classes:
AbstractContinuousDistribution, AbstractDistribution, AbstractIntegerDistribution, BetaDistributionImpl, BinomialDistributionImpl, CauchyDistributionImpl, ChiSquaredDistributionImpl, ExponentialDistributionImpl, FDistributionImpl, GammaDistributionImpl, HypergeometricDistributionImpl, NormalDistributionImpl, PascalDistributionImpl, PoissonDistributionImpl, TDistributionImpl, WeibullDistributionImpl, ZipfDistributionImpl

public interface Distribution

Base interface for probability distributions.

Version:
$Id: Distribution.java 1178295 2011-10-03 04:36:27Z psteitz $

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).
 double getNumericalMean()
          Use this method to get the numerical value of the mean of this distribution.
 double getNumericalVariance()
          Use this method to get the numerical value of the variance of this distribution.
 boolean isSupportConnected()
          Use this method to get information about whether the support is connected, i.e. whether all values between the lower and upper bound of the support is included in the support.
 boolean isSupportLowerBoundInclusive()
          Use this method to get information about whether the lower bound of the support is inclusive or not.
 boolean isSupportUpperBoundInclusive()
          Use this method to get information about whether the upper bound of the support is inclusive or not.
 

Method Detail

cumulativeProbability

double cumulativeProbability(double 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 (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

cumulativeProbability

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

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:
java.lang.IllegalArgumentException - if x0 > x1

getNumericalMean

double getNumericalMean()
Use this method to get the numerical value of the mean of this distribution.

Returns:
the mean or Double.NaN if it's not defined

getNumericalVariance

double getNumericalVariance()
Use this method to get the numerical value of the variance of this distribution.

Returns:
the variance (possibly Double.POSITIVE_INFINITY as for certain cases in TDistributionImpl) or Double.NaN if it's not defined

isSupportLowerBoundInclusive

boolean isSupportLowerBoundInclusive()
Use this method to get information about whether the lower bound of the support is inclusive or not.

Returns:
whether the lower bound of the support is inclusive or not

isSupportUpperBoundInclusive

boolean isSupportUpperBoundInclusive()
Use this method to get information about whether the upper bound of the support is inclusive or not.

Returns:
whether the upper bound of the support is inclusive or not

isSupportConnected

boolean isSupportConnected()
Use this method to get information about whether the support is connected, i.e. whether all values between the lower and upper bound of the support is included in the support. For AbstractIntegerDistribution the support is discrete, so if this is true, then the support is {lower bound, lower bound + 1, ..., upper bound}. For AbstractContinuousDistribution the support is continuous, so if this is true, then the support is the interval [lower bound, upper bound] where the limits are inclusive or not according to isSupportLowerBoundInclusive() and isSupportUpperBoundInclusive() (in the example both are true). If both are false, then the support is the interval (lower bound, upper bound)

Returns:
whether the support limits given by subclassed methods are connected or not


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