This is a utility class that provides computation methods related to the Beta family of functions.
Implementation of logBeta(double, double) is based on the
algorithms described in
| Modifier and Type | Field and Description |
|---|---|
| private static final double | DEFAULT_EPSILON
Maximum allowed numerical error. |
| private static final double[] | DELTA
The coefficients of the series expansion of the Δ function.</center> |
| private static final double | HALF_LOG_TWO_PI
The constant value of ½log 2π. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static double | Returns: the value ofDelta(b) - Delta(a + b)First argument. a, final double Second argument. b)Returns the value of Δ(b) - Δ(a + b), with 0 ≤ a ≤ b and b ≥ 10. |
| public static double | Returns: log(B(a, b)).Parameter a, double a.Parameter b, double b.This parameter is ignored. epsilon, int This parameter is ignored. maxIterations)
Deprecated
as of version 3.1, this method is deprecated as the
computation of the beta function is no longer iterative; it will be
removed in version 4.0.
Returns the natural logarithm of the beta function B(a, b). |
| public static double | Returns: the value oflog(Beta(p, q)), NaN if
p <= 0 or q <= 0.First argument. p, final double Second argument. q)Returns the value of log B(p, q) for 0 ≤ x ≤ 1 and p, q > 0. |
| private static double | Returns: the value oflog(Gamma(b) / Gamma(a + b)).First argument. a, final double Second argument. b)Returns the value of log[Γ(b) / Γ(a + b)] for a ≥ 0 and b ≥ 10. |
| private static double | Returns: the value oflog(Gamma(a + b)).First argument. a, final double Second argument. b)Returns the value of log Γ(a + b) for 1 ≤ a, b ≤ 2. |
| public static double | Returns: the regularized beta function I(x, a, b).Value. x, double Parameter a, double a.Parameter b)b.Returns the regularized beta function I(x, a, b). |
| public static double | Returns: the regularized beta function I(x, a, b)Value. x, double Parameter a, double a.Parameter b, double b.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. epsilon)Returns the regularized beta function I(x, a, b). |
| public static double | Returns: the regularized beta function I(x, a, b)the value. x, double Parameter a, double a.Parameter b, int b.Maximum number of "iterations" to complete. maxIterations)Returns the regularized beta function I(x, a, b). |
| public static double | Returns: the regularized beta function I(x, a, b)the value. x, final double Parameter a, final double a.Parameter b, double b.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. epsilon, int Maximum number of "iterations" to complete. maxIterations)Returns the regularized beta function I(x, a, b). |
| private static double | Returns: the value ofDelta(p) + Delta(q) - Delta(p + q).First argument. p, final double Second argument. q)Returns the value of Δ(p) + Δ(q) - Δ(p + q), with p, q ≥ 10. |
| DEFAULT_EPSILON | back to summary |
|---|---|
| private static final double DEFAULT_EPSILON Maximum allowed numerical error. | |
| DELTA | back to summary |
|---|---|
| private static final double[] DELTA The coefficients of the series expansion of the Δ function. This function is defined as follows see equation (23) in Didonato and Morris (1992). The series expansion, which applies for x ≥ 10, reads
14
====
1 \ 2 n
Δ(x) = --- > d (10 / x)
x / n
====
n = 0
| |
| HALF_LOG_TWO_PI | back to summary |
|---|---|
| private static final double HALF_LOG_TWO_PI The constant value of ½log 2π. | |
| Beta | back to summary |
|---|---|
| private Beta() Default constructor. Prohibit instantiation. | |
| deltaMinusDeltaSum | back to summary |
|---|---|
| private static double deltaMinusDeltaSum(final double a, final double b) throws OutOfRangeException, NumberIsTooSmallException Returns the value of Δ(b) - Δ(a + b), with 0 ≤ a ≤ b and b ≥ 10. Based on equations (26), (27) and (28) in Didonato and Morris (1992).
| |
| logBeta | back to summary |
|---|---|
| public static double logBeta(double a, double b, double epsilon, int maxIterations)
Deprecated as of version 3.1, this method is deprecated as the
computation of the beta function is no longer iterative; it will be
removed in version 4.0. Current implementation of this method
internally calls Returns the natural logarithm of the beta function B(a, b). The implementation of this method is based on:
| |
| logBeta | back to summary |
|---|---|
| public static double logBeta(final double p, final double q) Returns the value of log B(p, q) for 0 ≤ x ≤ 1 and p, q > 0. Based on the
NSWC Library of Mathematics Subroutines implementation,
| |
| logGammaMinusLogGammaSum | back to summary |
|---|---|
| private static double logGammaMinusLogGammaSum(final double a, final double b) throws NumberIsTooSmallException Returns the value of log[Γ(b) / Γ(a + b)] for a ≥ 0 and b ≥ 10. Based on
the NSWC Library of Mathematics Subroutines double precision
implementation,
| |
| logGammaSum | back to summary |
|---|---|
| private static double logGammaSum(final double a, final double b) throws OutOfRangeException Returns the value of log Γ(a + b) for 1 ≤ a, b ≤ 2. Based on the
NSWC Library of Mathematics Subroutines double precision
implementation,
| |
| regularizedBeta | back to summary |
|---|---|
| public static double regularizedBeta(double x, double a, double b) Returns the regularized beta function I(x, a, b).
| |
| regularizedBeta | back to summary |
|---|---|
| public static double regularizedBeta(double x, double a, double b, double epsilon) Returns the regularized beta function I(x, a, b).
| |
| regularizedBeta | back to summary |
|---|---|
| public static double regularizedBeta(double x, double a, double b, int maxIterations) Returns the regularized beta function I(x, a, b).
| |
| regularizedBeta | back to summary |
|---|---|
| public static double regularizedBeta(double x, final double a, final double b, double epsilon, int maxIterations) Returns the regularized beta function I(x, a, b). The implementation of this method is based on:
| |
| sumDeltaMinusDeltaSum | back to summary |
|---|---|
| private static double sumDeltaMinusDeltaSum(final double p, final double q) Returns the value of Δ(p) + Δ(q) - Δ(p + q), with p, q ≥ 10. Based on
the NSWC Library of Mathematics Subroutines double precision
implementation,
| |