public class Beta
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
Beta()
Make class non-instantiable but inheritable.
|
Modifier and Type | Method and Description |
---|---|
static double |
beta(double a,
double b)
Beta function.
|
static double |
incompleteBeta(double x,
double alpha,
double beta)
Cumulative probability density function for the incomplete beta function.
|
static double |
incompleteBeta(double x,
double alpha,
double beta,
int dPrec)
Cumulative probability density function for the incomplete beta function.
|
static double |
incompleteBetaInverse(double p,
double alpha,
double beta)
Compute value of inverse incomplete beta distribution.
|
static double |
logBeta(double a,
double b)
Log of the Beta distribution.
|
public static double logBeta(double a, double b)
a
- b
- The log of the beta distribution is calculated from the log of the gamma distribution using the following relationship:
logBeta(a,b) = logGamma(a) + logGamma(b) - logGamma( a + b )public static double beta(double a, double b) throws java.lang.ArithmeticException
a
- b
- The beta distribution value is calculated from the gamma distribution using the following relationship:
Beta(a,b) = ( Gamma(a) * Gamma(b) ) / Gamma( a + b )java.lang.ArithmeticException
public static double incompleteBeta(double x, double alpha, double beta, int dPrec) throws java.lang.IllegalArgumentException
x
- Upper percentage point of incomplete beta
probability density functionalpha
- First shape parameterbeta
- Second shape parameterdPrec
- Digits of precision desired (1 < dPrec < Constants.MAXPREC)java.lang.IllegalArgumentException
- if x <= 0 or a <= 0 or b <= 0 .
The continued fraction expansion as given by Abramowitz and Stegun (1964) is used. This method works well unless the minimum of (alpha, beta) exceeds about 70000. For most common values the result will be accurate to about 14 decimal digits.
public static double incompleteBeta(double x, double alpha, double beta) throws java.lang.IllegalArgumentException
x
- Upper percentage point of incomplete beta
probability density functionalpha
- First shape parameterbeta
- Second shape parameterjava.lang.IllegalArgumentException
- if x <= 0 or a <= 0 or b <= 0 .
The continued fraction expansion as given by Abramowitz and Stegun (1964) is used. This method works well unless the minimum of (alpha, beta) exceeds about 70000. For most common values the result will be accurate to about 14 decimal digits.
public static double incompleteBetaInverse(double p, double alpha, double beta) throws java.lang.IllegalArgumentException
p
- Probability value.alpha
- First shape parameter.beta
- Second shape parameter.java.lang.IllegalArgumentException
- if alpha <= 0 or beta <= 0 or p <= 0 or p >= 1 .