org.statcato.statistics
Class SpecialFunctions
- java.lang.Object
-
- org.statcato.statistics.SpecialFunctions
-
public class SpecialFunctions extends java.lang.ObjectA class of special functions that are used in calculating probability distributions. Based on Numerical Reciples in C: The Art of Scientific Computing (1992) http://www.nr.com- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor and Description SpecialFunctions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static doublebeta(double z, double w)Returns the beta function evaluated at (z,w).static doublebetacf(double a, double b, double x)Used by betai: Evaluates continued fraction for incomplete beta function by modified Lentz's method.static doublebetai(double a, double b, double x)Returns the incomplete beta function Ix(a, b).static doublebinomialCoefficient(int n, int k)Returns the bionomial coefficient (n k) as a floating-point number.static doublecumBinomial(int n, int k, double p)Returns the cumulative binomial probability given n, k, and p, the probability of less than k successes occurring in n trials if a success occurs with probability p per trialstatic doublecumChiSquare(double chi2, double v1)static doublecumF(double F, double v1, double v2)static doublecumNorm(double z)static doublecumT(double t, double v1)static doubleerff(double x)Returns the error function erf(x).static doubleerffc(double x)Returns the complementary error function erfc(x).static doublefactln(int n)Returns the natural logarithm of the factorial of a number: ln(n!).static doublefactrl(int n)Returns the factorial of an integer.static doublegammln(double xx)Returns the value ln[ gamma(xx)] for xx > 0.static doublegammp(double a, double x)Returns the incomplete gamma function P(a, x).static doublegammq(double a, double x)Returns the incomplete gamm function Q(a, x) = 1 - P(a, x)static voidgcf(double a, double x)Computes the incomplete gamma function Q(a; x) evaluated by its continued fraction representation as gammcf.static voidgser(double a, double x)Computes the incomplete gamma function P(a, x) evaluated by its series representation and stores in global variable gamser.static voidnrerror(java.lang.String s)static doublesign(double a, double b)Returns the magnitude of a times the sign of b
-
-
-
Method Detail
-
nrerror
public static void nrerror(java.lang.String s)
-
gammln
public static double gammln(double xx)
Returns the value ln[ gamma(xx)] for xx > 0.- Parameters:
xx- a number- Returns:
- ln[gamma(xx)]
-
factrl
public static double factrl(int n)
Returns the factorial of an integer.- Parameters:
n-- Returns:
- n! -1 indicates an error.
-
factln
public static double factln(int n)
Returns the natural logarithm of the factorial of a number: ln(n!).- Parameters:
n-- Returns:
- ln(n!). -1 is returned for an error.
-
binomialCoefficient
public static double binomialCoefficient(int n, int k)Returns the bionomial coefficient (n k) as a floating-point number.- Parameters:
n-k-- Returns:
- binomial coefficient
-
beta
public static double beta(double z, double w)Returns the beta function evaluated at (z,w).- Parameters:
z-w-- Returns:
- B(z,w)
-
gammp
public static double gammp(double a, double x)Returns the incomplete gamma function P(a, x).- Parameters:
a-x-- Returns:
- P(a, x)
-
gammq
public static double gammq(double a, double x)Returns the incomplete gamm function Q(a, x) = 1 - P(a, x)- Parameters:
a-x-- Returns:
- Q(a, x)
-
gser
public static void gser(double a, double x)Computes the incomplete gamma function P(a, x) evaluated by its series representation and stores in global variable gamser. Also computes ln _(a) and stores in global variable gln.- Parameters:
a-x-
-
gcf
public static void gcf(double a, double x)Computes the incomplete gamma function Q(a; x) evaluated by its continued fraction representation as gammcf. Also computes ln _(a) as gln.- Parameters:
a-x-
-
erff
public static double erff(double x)
Returns the error function erf(x).- Parameters:
x-- Returns:
- erf(x)
-
erffc
public static double erffc(double x)
Returns the complementary error function erfc(x).- Parameters:
x-- Returns:
- erffc(x)
-
betai
public static double betai(double a, double b, double x)Returns the incomplete beta function Ix(a, b).- Parameters:
a-b-x-- Returns:
- incomplete beta function value
-
betacf
public static double betacf(double a, double b, double x)Used by betai: Evaluates continued fraction for incomplete beta function by modified Lentz's method.- Parameters:
a-b-x-- Returns:
- betacf
-
cumT
public static double cumT(double t, double v1)
-
cumF
public static double cumF(double F, double v1, double v2)
-
cumNorm
public static double cumNorm(double z)
-
cumChiSquare
public static double cumChiSquare(double chi2, double v1)
-
cumBinomial
public static double cumBinomial(int n, int k, double p)Returns the cumulative binomial probability given n, k, and p, the probability of less than k successes occurring in n trials if a success occurs with probability p per trial- Parameters:
n- the number of trialsk- the number of successesp- the probability of success- Returns:
- P(n, k, p)
-
sign
public static double sign(double a, double b)Returns the magnitude of a times the sign of b- Parameters:
a-b-- Returns:
- the magnitude of a times the sign of b
-
-
DMelt 3.0 © DataMelt by jWork.ORG