Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.commons.math.special
Class Gamma

    java.lang.Object
      org.apache.commons.math.special.Gamma

All Implemented Interfaces:
  Serializable

public class Gamma
extends Object
implements Serializable

This is a utility class that provides computation methods related to the Gamma family of functions.

Version:
  $Revision: 1.22 $ $Date: 2004/10/08 05:53:18 $
See Also:
  Serialized Form

Method Summary
`static double` | `logGamma(double x)` Returns the natural logarithm of the gamma function Γ(x).
`static double` | `regularizedGammaP(double a, double x)` Returns the regularized gamma function P(a, x).
`static double` | `regularizedGammaP(double a, double x, double epsilon, int maxIterations)` Returns the regularized gamma function P(a, x).
`static double` | `regularizedGammaQ(double a, double x)` Returns the regularized gamma function Q(a, x) = 1 - P(a, x).
`static double` | `regularizedGammaQ(double a, double x, double epsilon, int maxIterations)` Returns the regularized gamma function Q(a, x) = 1 - P(a, x).

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### logGamma

    public static double logGamma(double x)

  Returns the natural logarithm of the gamma function Γ(x). The implementation of this method is based on:
  - Gamma Function, equation (28).
  - Lanczos Approximation, equations (1) through (5).
  - Paul Godfrey, A note on the computation of the convergent Lanczos complex Gamma approximation

  Parameters:
    `x` - the value.
  Returns:
    log(Γ(x))

### regularizedGammaP

    public static double regularizedGammaP(double a,
                                           double x)
                                    throws MathException

  Returns the regularized gamma function P(a, x).

  Parameters:
    `a` - the a parameter.
    `x` - the value.
  Returns:
    the regularized gamma function P(a, x)
  Throws:
    `MathException` - if the algorithm fails to converge.

### regularizedGammaP

    public static double regularizedGammaP(double a,
                                           double x,
                                           double epsilon,
                                           int maxIterations)
                                    throws MathException

  Returns the regularized gamma function P(a, x). The implementation of this method is based on:
  - Regularized Gamma Function, equation (1).
  - Incomplete Gamma Function, equation (4).
  - Confluent Hypergeometric Function of the First Kind, equation (1).

  Parameters:
    `a` - the a parameter.
    `x` - the value.
    `epsilon` - When the absolute value of the nth item in the series is less than epsilon the approximation ceases to calculate further elements in the series.
    `maxIterations` - Maximum number of "iterations" to complete.
  Returns:
    the regularized gamma function P(a, x)
  Throws:
    `MathException` - if the algorithm fails to converge.

### regularizedGammaQ

    public static double regularizedGammaQ(double a,
                                           double x)
                                    throws MathException

  Returns the regularized gamma function Q(a, x) = 1 - P(a, x).

  Parameters:
    `a` - the a parameter.
    `x` - the value.
  Returns:
    the regularized gamma function Q(a, x)
  Throws:
    `MathException` - if the algorithm fails to converge.

### regularizedGammaQ

    public static double regularizedGammaQ(double a,
                                           double x,
                                           double epsilon,
                                           int maxIterations)
                                    throws MathException

  Returns the regularized gamma function Q(a, x) = 1 - P(a, x). The implementation of this method is based on:
  - Regularized Gamma Function, equation (1).
  - Regularized incomplete gamma function: Continued fraction representations (formula 06.08.10.0003)

  Parameters:
    `a` - the a parameter.
    `x` - the value.
    `epsilon` - When the absolute value of the nth item in the series is less than epsilon the approximation ceases to calculate further elements in the series.
    `maxIterations` - Maximum number of "iterations" to complete.
  Returns:
    the regularized gamma function P(a, x)
  Throws:
    `MathException` - if the algorithm fails to converge.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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