public class Statistics
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static double |
big
Big number
|
protected static double |
biginv
Inverse big number
|
protected static double |
LOGPI
Logarithm of PI
|
protected static double |
MACHEP
MACHEP constant
|
protected static double |
MAXGAM
Maximun gamma value
|
protected static double |
MAXLOG
Maximum logarithm value
|
protected static double |
MINLOG
Minimum logarithm value
|
protected static double[] |
P0
approximation for 0 <= |y - 0.5| <= 3/8
|
protected static double[] |
P1 |
protected static double[] |
P2 |
protected static double[] |
Q0 |
protected static double[] |
Q1 |
protected static double[] |
Q2 |
protected static double |
SQRTH
squared root of H
|
protected static double |
SQTPI
squared root of PI
|
Constructor and Description |
---|
Statistics() |
Modifier and Type | Method and Description |
---|---|
static double |
binomialStandardError(double p,
int n)
Computes standard error for observed values of a binomial
random variable.
|
static double |
chiSquaredProbability(double x,
double v)
Returns chi-squared probability for given value and degrees
of freedom.
|
static double |
FProbability(double F,
int df1,
int df2)
Computes probability of F-ratio.
|
static double |
incompleteBeta(double aa,
double bb,
double xx)
Returns the Incomplete Beta Function evaluated from zero to xx.
|
static double |
lnGamma(double x)
Returns natural logarithm of gamma function.
|
static void |
main(java.lang.String[] ops)
Main method for testing this class.
|
static double |
normalInverse(double y0)
Returns the value, x, for which the area under the
Normal (Gaussian) probability density function (integrated from
minus infinity to x) is equal to the argument y
(assumes mean is zero, variance is one).
|
static double |
normalProbability(double a)
Returns the area under the Normal (Gaussian) probability density
function, integrated from minus infinity to x
(assumes mean is zero, variance is one).
|
protected static final double MACHEP
protected static final double MAXLOG
protected static final double MINLOG
protected static final double MAXGAM
protected static final double SQTPI
protected static final double SQRTH
protected static final double LOGPI
protected static final double big
protected static final double biginv
protected static final double[] P0
protected static final double[] Q0
protected static final double[] P1
protected static final double[] Q1
protected static final double[] P2
protected static final double[] Q2
public static double binomialStandardError(double p, int n)
p
- the probability of successn
- the size of the samplepublic static double chiSquaredProbability(double x, double v)
x
- the valuev
- the number of degrees of freedompublic static double FProbability(double F, int df1, int df2)
F
- the F-ratiodf1
- the first number of degrees of freedomdf2
- the second number of degrees of freedompublic static double normalProbability(double a)
x - 1 | | 2 normal(x) = --------- | exp( - t /2 ) dt sqrt(2pi) | | - -inf. = ( 1 + erf(z) ) / 2 = erfc(z) / 2where z = x/sqrt(2). Computation is via the functions errorFunction and errorFunctionComplement.
a
- the z-valuepublic static double normalInverse(double y0)
For small arguments 0 < y < exp(-2), the program computes z = sqrt( -2.0 * log(y) ); then the approximation is x = z - log(z)/z - (1/z) P(1/z) / Q(1/z). There are two rational functions P/Q, one for 0 < y < exp(-32) and the other for y up to exp(-2). For larger arguments, w = y - 0.5, and x/sqrt(2pi) = w + w**3 R(w**2)/S(w**2)).
y0
- the area under the normal pdfpublic static double lnGamma(double x)
x
- the valuepublic static double incompleteBeta(double aa, double bb, double xx)
aa
- the alpha parameter of the beta distribution.bb
- the beta parameter of the beta distribution.xx
- the integration end point.public static void main(java.lang.String[] ops)
ops
- main args.