Package cern.jet.stat
Class Gamma
- java.lang.Object
-
- cern.jet.math.Constants
-
- 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.
- Version:
- 0.9, 22-Jun-99
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedGamma()Makes this class non instantiable, but still let's others inherit from it.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doublebeta(double a, double b)Returns the beta function of the arguments.static doublegamma(double x)Returns the Gamma function of the argument.static doubleincompleteBeta(double aa, double bb, double xx)Returns the Incomplete Beta Function evaluated from zero to xx; formerly named ibeta.(package private) static doubleincompleteBetaFraction1(double a, double b, double x)Continued fraction expansion #1 for incomplete beta integral; formerly named incbcf.(package private) static doubleincompleteBetaFraction2(double a, double b, double x)Continued fraction expansion #2 for incomplete beta integral; formerly named incbd.static doubleincompleteGamma(double a, double x)Returns the Incomplete Gamma function; formerly named igamma.static doubleincompleteGammaComplement(double a, double x)Returns the Complemented Incomplete Gamma function; formerly named igamc.static doublelogGamma(double x)Returns the natural logarithm of the gamma function; formerly named lgamma.(package private) static doublepowerSeries(double a, double b, double x)Power series for incomplete beta integral; formerly named pseries.(package private) static doublestirlingFormula(double x)Returns the Gamma function computed by Stirling's formula; formerly named stirf.
-
-
-
Method Detail
-
beta
public static double beta(double a, double b) throws java.lang.ArithmeticExceptionReturns 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.ArithmeticExceptionReturns the Gamma function of the argument.- Throws:
java.lang.ArithmeticException
-
incompleteBeta
public static double incompleteBeta(double aa, double bb, double xx) throws java.lang.ArithmeticExceptionReturns 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
-
incompleteBetaFraction1
static double incompleteBetaFraction1(double a, double b, double x) throws java.lang.ArithmeticExceptionContinued fraction expansion #1 for incomplete beta integral; formerly named incbcf.- Throws:
java.lang.ArithmeticException
-
incompleteBetaFraction2
static double incompleteBetaFraction2(double a, double b, double x) throws java.lang.ArithmeticExceptionContinued fraction expansion #2 for incomplete beta integral; formerly named incbd.- Throws:
java.lang.ArithmeticException
-
incompleteGamma
public static double incompleteGamma(double a, double x) throws java.lang.ArithmeticExceptionReturns 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.ArithmeticExceptionReturns 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.ArithmeticExceptionReturns the natural logarithm of the gamma function; formerly named lgamma.- Throws:
java.lang.ArithmeticException
-
powerSeries
static double powerSeries(double a, double b, double x) throws java.lang.ArithmeticExceptionPower series for incomplete beta integral; formerly named pseries. Use when b*x is small and x not too close to 1.- Throws:
java.lang.ArithmeticException
-
stirlingFormula
static double stirlingFormula(double x) throws java.lang.ArithmeticExceptionReturns the Gamma function computed by Stirling's formula; formerly named stirf. The polynomial STIR is valid for 33 <= x <= 172.- Throws:
java.lang.ArithmeticException
-
-