org.apache.commons.math.distribution
Class GammaDistributionImpl

java.lang.Object
  extended byorg.apache.commons.math.distribution.AbstractContinuousDistribution
      extended byorg.apache.commons.math.distribution.GammaDistributionImpl
All Implemented Interfaces:
ContinuousDistribution, GammaDistribution, Serializable

public class GammaDistributionImpl
extends AbstractContinuousDistribution
implements GammaDistribution, Serializable

The default implementation of GammaDistribution

Version:
$Revision: 1.14 $ $Date: 2003/11/19 03:22:53 $
See Also:
Serialized Form

Constructor Summary
GammaDistributionImpl(double alpha, double beta)
          Create a new gamma distribution with the given alpha and beta values.
 
Method Summary
 double cummulativeProbability(double x)
          For this disbution, X, this method returns P(X < x).
 double getAlpha()
          Access the shape parameter, alpha
 double getBeta()
          Access the scale parameter, beta
protected  double getDomainLowerBound(double p)
          Access the domain value lower bound, based on p, used to bracket a CDF root.
protected  double getDomainUpperBound(double p)
          Access the domain value upper bound, based on p, used to bracket a CDF root.
protected  double getInitialDomain(double p)
          Access the initial domain value, based on p, used to bracket a CDF root.
 void setAlpha(double alpha)
          Modify the shape parameter, alpha.
 void setBeta(double beta)
          Modify the scale parameter, beta.
 
Methods inherited from class org.apache.commons.math.distribution.AbstractContinuousDistribution
cummulativeProbability, inverseCummulativeProbability
 
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, inverseCummulativeProbability
 

Constructor Detail

GammaDistributionImpl

public GammaDistributionImpl(double alpha,
                             double beta)
Create a new gamma distribution with the given alpha and beta values.

Parameters:
alpha - the shape parameter.
beta - the scale parameter.
Method Detail

cummulativeProbability

public double cummulativeProbability(double x)
                              throws MathException
For this disbution, X, this method returns P(X < x). The implementation of this method is based on:

Specified by:
cummulativeProbability in interface ContinuousDistribution
Parameters:
x - the value at which the CDF is evaluated.
Returns:
CDF for this distribution.
Throws:
MathException

setAlpha

public void setAlpha(double alpha)
Modify the shape parameter, alpha.

Specified by:
setAlpha in interface GammaDistribution
Parameters:
alpha - the new shape parameter.

getAlpha

public double getAlpha()
Access the shape parameter, alpha

Specified by:
getAlpha in interface GammaDistribution
Returns:
alpha.

setBeta

public void setBeta(double beta)
Modify the scale parameter, beta.

Specified by:
setBeta in interface GammaDistribution
Parameters:
beta - the new scale parameter.

getBeta

public double getBeta()
Access the scale parameter, beta

Specified by:
getBeta in interface GammaDistribution
Returns:
beta.

getDomainLowerBound

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

Specified by:
getDomainLowerBound in class AbstractContinuousDistribution
Parameters:
p - the desired probability for the critical value
Returns:
domain value lower bound, i.e. P(X < lower bound) < p TODO: try to improve on this estimate

getDomainUpperBound

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

Specified by:
getDomainUpperBound in class AbstractContinuousDistribution
Parameters:
p - the desired probability for the critical value
Returns:
domain value upper bound, i.e. P(X < upper bound) > p TODO: try to improve on this estimate

getInitialDomain

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

Specified by:
getInitialDomain in class AbstractContinuousDistribution
Parameters:
p - the desired probability for the critical value
Returns:
initial domain value TODO: try to improve on this estimate


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