MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / lnBeta

Method lnBeta

JSAT/src/jsat/math/SpecialMath.java:539–555  ·  view source on GitHub ↗
(double z, double w)

Source from the content-addressed store, hash-verified

537 }
538
539 public static double lnBeta(double z, double w)
540 {
541 /*
542 * The beta function is defined by
543 *
544 * Gamma(z) Gamma(w)
545 * B(z, w) = -----------------
546 * Gamma(z + w)
547 *
548 * However, the definition is numericaly unstable (large value / large value to small result & small input).
549 * Taking the log of each size and then exponentiating gives a more stable method of computing the result
550 *
551 * lnGamma(z) + lnGamma(w) - lnGamma(z + w)
552 * B(z, w) = e
553 */
554 return lnGamma(z)+lnGamma(w)-lnGamma(z+w);
555 }
556
557 /**
558 * Computes the regularized incomplete beta function, I<sub>x</sub>(a, b). The result of which is always in the range [0, 1]

Callers 4

betaMethod · 0.95
betaIncRegMethod · 0.95
pdfMethod · 0.80
logPdfMethod · 0.80

Calls 1

lnGammaMethod · 0.95

Tested by

no test coverage detected