|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectpapaya.Gamma
public class Gamma
Gamma and Beta functions.
Implementation:
The code is mostly adapted from the CERN
Jet Java libraries, which in turn was adapted from the Cephes Mathematical Library. As far a
as I can tell, Stephen L. Moshier wrote the original C++ code for CEPHES (1989, moshier@na-net.ornl.gov)
and Wolfgang Hoschek (at CERN, hats off to you mate!) then adapted it for the
Java platform, making some significant changes along the way.
| Field Summary |
|---|
| Fields inherited from interface papaya.PapayaConstants |
|---|
BASELINE, big, biginv, BOTTOM, CENTER, CORNER, FONTNAME, GRAY, INDEX_NOT_FOUND, INDICES_NOT_FOUND, LEFT, LOGPI, MACHEP, MAXGAM, MAXLOG, MINLOG, RIGHT, SQRTH, SQTPI, STROKEWEIGHT, TEXTSIZE, TOP |
| Method Summary | |
|---|---|
static float |
beta(double a,
double b)
Returns the beta function of the arguments. |
static double |
gamma(double x)
Returns the Gamma function of the argument, Γ(x) |
static double |
incompleteBeta(double aa,
double bb,
double xx)
Returns the Incomplete Beta Function evaluated from zero to xx; formerly named ibeta. |
static double |
incompleteBetaInverse(double aa,
double bb,
double yy0)
Returns the inverse of the incomplete Beta integral. |
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 |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static float beta(double a,
double b)
throws ArithmeticException
beta( a, b ) = Γ(a) * Γ(b) ) Γ(a+b)
ArithmeticException
public static double gamma(double x)
throws ArithmeticException
Γ(x)
ArithmeticException
public static double incompleteBeta(double aa,
double bb,
double xx)
throws ArithmeticException
xx; formerly named ibeta.
aa - the alpha parameter of the beta distribution.bb - the beta parameter of the beta distribution.xx - the integration end point.
ArithmeticException
public static double incompleteBetaInverse(double aa,
double bb,
double yy0)
y, the function finds x such that
incompleteBeta( a, b, x ) = y.The routine performs interval halving until
incompleteBeta(a,b,x) - y = 0,
to within roughly 10^-13 of the true solution. If this precision is not reached, the
method returns the current approximation of x, and prints a warning statement
specifying the current error. Typically, this is on the order of 10^-12.
aa - the alpha parameter of the beta distribution.bb - the beta parameter of the beta distribution.yy0 - the value for which to solve for the corresponding x in the
incomplete Beta integral.
x such that incompleteBeta( a, b, x ) = y.
public static double incompleteGamma(double a,
double x)
throws ArithmeticException
igamma.
a - the parameter of the gamma distribution.x - the integration end point.
ArithmeticException
public static double incompleteGammaComplement(double a,
double x)
throws ArithmeticException
a - the parameter of the gamma distribution.x - the integration start point.
ArithmeticException
public static double logGamma(double x)
throws ArithmeticException
lgamma.
ArithmeticException
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||