Package org.apache.commons.numbers.gamma
Class RegularizedBeta
- java.lang.Object
-
- org.apache.commons.numbers.gamma.RegularizedBeta
-
public final class RegularizedBeta extends Object
Regularized Beta function.\[ I_x(a,b) = \frac{1}{B(a, b)} \int_0^x t^{a-1}\,(1-t)^{b-1}\,dt \]
where \( B(a, b) \) is the beta function.
This code has been adapted from the Boost
c++
implementation<boost/math/special_functions/beta.hpp>
.- See Also:
- Boost C++ Incomplete Beta functions
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static double
complement(double x, double a, double b)
Computes the complement of the regularized beta function I(x, a, b).static double
complement(double x, double a, double b, double epsilon, int maxIterations)
Computes the complement of the regularized beta function I(x, a, b).static double
derivative(double x, double a, double b)
Computes the derivative of the regularized beta function I(x, a, b).static double
value(double x, double a, double b)
Computes the value of the regularized beta function I(x, a, b).static double
value(double x, double a, double b, double epsilon, int maxIterations)
Computes the value of the regularized beta function I(x, a, b).
-
-
-
Method Detail
-
value
public static double value(double x, double a, double b)
Computes the value of the regularized beta function I(x, a, b).\[ I_x(a,b) = \frac{1}{B(a, b)} \int_0^x t^{a-1}\,(1-t)^{b-1}\,dt \]
where \( B(a, b) \) is the beta function.
- Parameters:
x
- Value.a
- Parametera
.b
- Parameterb
.- Returns:
- the regularized beta function \( I_x(a, b) \).
- Throws:
ArithmeticException
- if the series evaluation fails to converge.
-
value
public static double value(double x, double a, double b, double epsilon, int maxIterations)
Computes the value of the regularized beta function I(x, a, b).\[ I_x(a,b) = \frac{1}{B(a, b)} \int_0^x t^{a-1}\,(1-t)^{b-1}\,dt \]
where \( B(a, b) \) is the beta function.
- Parameters:
x
- the value.a
- Parametera
.b
- Parameterb
.epsilon
- Tolerance in series evaluation.maxIterations
- Maximum number of iterations in series evaluation.- Returns:
- the regularized beta function \( I_x(a, b) \).
- Throws:
ArithmeticException
- if the series evaluation fails to converge.
-
complement
public static double complement(double x, double a, double b)
Computes the complement of the regularized beta function I(x, a, b).\[ 1 - I_x(a,b) = I_{1-x}(b, a) \]
- Parameters:
x
- Value.a
- Parametera
.b
- Parameterb
.- Returns:
- the complement of the regularized beta function \( 1 - I_x(a, b) \).
- Throws:
ArithmeticException
- if the series evaluation fails to converge.- Since:
- 1.1
-
complement
public static double complement(double x, double a, double b, double epsilon, int maxIterations)
Computes the complement of the regularized beta function I(x, a, b).\[ 1 - I_x(a,b) = I_{1-x}(b, a) \]
- Parameters:
x
- the value.a
- Parametera
.b
- Parameterb
.epsilon
- Tolerance in series evaluation.maxIterations
- Maximum number of iterations in series evaluation.- Returns:
- the complement of the regularized beta function \( 1 - I_x(a, b) \).
- Throws:
ArithmeticException
- if the series evaluation fails to converge.- Since:
- 1.1
-
derivative
public static double derivative(double x, double a, double b)
Computes the derivative of the regularized beta function I(x, a, b).\[ \frac{\delta}{\delta x} I_x(a,b) = \frac{(1-x)^{b-1} x^{a-1}}{B(a, b)} \]
where \( B(a, b) \) is the beta function.
This function has uses in some statistical distributions.
- Parameters:
x
- Value.a
- Parametera
.b
- Parameterb
.- Returns:
- the derivative of the regularized beta function \( I_x(a, b) \).
- Throws:
ArithmeticException
- if the series evaluation fails to converge.- Since:
- 1.1
-
-