cern.jet.stat
Class Gamma

java.lang.Object
  extended by cern.jet.math.Constants
      extended by cern.jet.stat.Gamma

public class Gamma
extends Constants

Gamma and Beta functions.

Implementation:

Some code taken and adapted from the Java 2D Graph Package 2.4, which in turn is a port from the Cephes 2.2 Math Library (C). Most Cephes code (missing from the 2D Graph Package) directly ported.

Author:
wolfgang.hoschek@cern.ch

Field Summary
 
Fields inherited from class cern.jet.math.Constants
big, biginv, LOGPI, MACHEP, MAXGAM, MAXLOG, MINLOG, SQRTH, SQTPI
 
Constructor Summary
protected Gamma()
          Makes this class non instantiable, but still let's others inherit from it.
 
Method Summary
static double beta(double a, double b)
          Returns the beta function of the arguments.
static double gamma(double x)
          Returns the Gamma function of the argument.
static double incompleteBeta(double aa, double bb, double xx)
          Returns the Incomplete Beta Function evaluated from zero to xx; formerly named ibeta.
static double incompleteGamma(double a, double x)
          Returns the Incomplete Gamma function; formerly named igamma.
static double incompleteGammaComplement(double a, double x)
          Returns the Complemented Incomplete Gamma function; formerly named igamc.
static double logGamma(double x)
          Returns the natural logarithm of the gamma function; formerly named lgamma.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Gamma

protected Gamma()
Makes this class non instantiable, but still let's others inherit from it.

Method Detail

beta

public static double beta(double a,
                          double b)
                   throws java.lang.ArithmeticException
Returns the beta function of the arguments.
                   -     -
                  | (a) | (b)
 beta( a, b )  =  -----------.
                     -
                    | (a+b)
 

Throws:
java.lang.ArithmeticException

gamma

public static double gamma(double x)
                    throws java.lang.ArithmeticException
Returns the Gamma function of the argument.

Throws:
java.lang.ArithmeticException

incompleteBeta

public static double incompleteBeta(double aa,
                                    double bb,
                                    double xx)
                             throws java.lang.ArithmeticException
Returns the Incomplete Beta Function evaluated from zero to xx; formerly named ibeta.

Parameters:
aa - the alpha parameter of the beta distribution.
bb - the beta parameter of the beta distribution.
xx - the integration end point.
Throws:
java.lang.ArithmeticException

incompleteGamma

public static double incompleteGamma(double a,
                                     double x)
                              throws java.lang.ArithmeticException
Returns the Incomplete Gamma function; formerly named igamma.

Parameters:
a - the parameter of the gamma distribution.
x - the integration end point.
Throws:
java.lang.ArithmeticException

incompleteGammaComplement

public static double incompleteGammaComplement(double a,
                                               double x)
                                        throws java.lang.ArithmeticException
Returns the Complemented Incomplete Gamma function; formerly named igamc.

Parameters:
a - the parameter of the gamma distribution.
x - the integration start point.
Throws:
java.lang.ArithmeticException

logGamma

public static double logGamma(double x)
                       throws java.lang.ArithmeticException
Returns the natural logarithm of the gamma function; formerly named lgamma.

Throws:
java.lang.ArithmeticException