Class Statistics
- java.lang.Object
-
- org.processmining.plugins.workshop.Yaguang.WekaDiscriminationTree.Statistics
-
public class Statistics extends java.lang.ObjectClass implementing some distributions, tests, etc. The code is mostly adapted from the CERN Jet Java libraries: Copyright 2001 University of Waikato Copyright 1999 CERN - European Organization for Nuclear Research. Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. CERN and the University of Waikato make no representations about the suitability of this software for any purpose. It is provided "as is" without expressed or implied warranty.- Version:
- $Revision: 1.8 $
- Author:
- peter.gedeck@pharma.Novartis.com, wolfgang.hoschek@cern.ch, Eibe Frank (eibe@cs.waikato.ac.nz), Richard Kirkby (rkirkby@cs.waikato.ac.nz)
-
-
Field Summary
Fields Modifier and Type Field Description protected static doublebigprotected static doublebiginvprotected static doubleLOGPIprotected static doubleMACHEPSome constantsprotected static doubleMAXGAMprotected static doubleMAXLOGprotected static doubleMINLOGprotected static double[]P0COEFFICIENTS FOR METHOD normalInverse() *protected static double[]P1protected static double[]P2protected static double[]Q0protected static double[]Q1protected static double[]Q2protected static doubleSQRTHprotected static doubleSQTPI
-
Constructor Summary
Constructors Constructor Description Statistics()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doublebinomialStandardError(double p, int n)Computes standard error for observed values of a binomial random variable.static doublechiSquaredProbability(double x, double v)Returns chi-squared probability for given value and degrees of freedom.static doubleFProbability(double F, int df1, int df2)Computes probability of F-ratio.static doubleincompleteBeta(double aa, double bb, double xx)Returns the Incomplete Beta Function evaluated from zero to xx.static doublelnGamma(double x)Returns natural logarithm of gamma function.static voidmain(java.lang.String[] ops)Main method for testing this class.static doublenormalInverse(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 doublenormalProbability(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).
-
-
-
Field Detail
-
MACHEP
protected static final double MACHEP
Some constants- See Also:
- Constant Field Values
-
MAXLOG
protected static final double MAXLOG
- See Also:
- Constant Field Values
-
MINLOG
protected static final double MINLOG
- See Also:
- Constant Field Values
-
MAXGAM
protected static final double MAXGAM
- See Also:
- Constant Field Values
-
SQTPI
protected static final double SQTPI
- See Also:
- Constant Field Values
-
SQRTH
protected static final double SQRTH
- See Also:
- Constant Field Values
-
LOGPI
protected static final double LOGPI
- See Also:
- Constant Field Values
-
big
protected static final double big
- See Also:
- Constant Field Values
-
biginv
protected static final double biginv
- See Also:
- Constant Field Values
-
P0
protected static final double[] P0
COEFFICIENTS FOR METHOD normalInverse() *
-
Q0
protected static final double[] Q0
-
P1
protected static final double[] P1
-
Q1
protected static final double[] Q1
-
P2
protected static final double[] P2
-
Q2
protected static final double[] Q2
-
-
Method Detail
-
binomialStandardError
public static double binomialStandardError(double p, int n)Computes standard error for observed values of a binomial random variable.- Parameters:
p- the probability of successn- the size of the sample- Returns:
- the standard error
-
chiSquaredProbability
public static double chiSquaredProbability(double x, double v)Returns chi-squared probability for given value and degrees of freedom. (The probability that the chi-squared variate will be greater than x for the given degrees of freedom.)- Parameters:
x- the valuedf- the number of degrees of freedom- Returns:
- the chi-squared probability
-
FProbability
public static double FProbability(double F, int df1, int df2)Computes probability of F-ratio.- Parameters:
F- the F-ratiodf1- the first number of degrees of freedomdf2- the second number of degrees of freedom- Returns:
- the probability of the F-ratio.
-
normalProbability
public 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).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.- Parameters:
a- the z-value- Returns:
- the probability of the z value according to the normal pdf
-
normalInverse
public 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).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)).
- Parameters:
y0- the area under the normal pdf- Returns:
- the z-value
-
lnGamma
public static double lnGamma(double x)
Returns natural logarithm of gamma function.- Parameters:
x- the value- Returns:
- natural logarithm of gamma function
-
incompleteBeta
public static double incompleteBeta(double aa, double bb, double xx)Returns the Incomplete Beta Function evaluated from zero to xx.- Parameters:
aa- the alpha parameter of the beta distribution.bb- the beta parameter of the beta distribution.xx- the integration end point.
-
main
public static void main(java.lang.String[] ops)
Main method for testing this class.
-
-