edu.northwestern.at.utils.math.distributions
Class ErrorFunction

java.lang.Object
  extended by edu.northwestern.at.utils.math.distributions.ErrorFunction

public class ErrorFunction
extends java.lang.Object

Gaussian error function distribution functions.


Constructor Summary
protected ErrorFunction()
          Make class non-instantiable but inheritable.
 
Method Summary
protected static double calerf(double x, int jint)
          Calculate value of Gaussian error function.
static double errorFunction(double x)
          Error function.
static double errorFunctionComplement(double x)
          Error function complement.
static double errorFunctionComplementInverseBad(double x)
           
static double errorFunctionInverse(double z)
          Inverse error function.
static double errorFunctionInverseBad(double x)
          Percentage points of error function distribution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ErrorFunction

protected ErrorFunction()
Make class non-instantiable but inheritable.

Method Detail

calerf

protected static double calerf(double x,
                               int jint)
Calculate value of Gaussian error function.

Parameters:
x -
jint - Selects type of error function evaluation. = 0: error function = 1: complement of error function. = 2: exp(xx) * complement of error function.
Returns:
Error function value.

The program returns erfc=0 for x > XBIG (see below); erfcx = XINF for x < XNEG; and erfcx = 0 for x >= XMAX.

The main computation evaluates near-minimax approximations from "Rational Chebyshev approximations for the error function" by W. J. Cody, Math. Comp., 1969, PP. 631-638. This java code is a straightforward translation of W. J. Cody's Fortran CALERF function.


errorFunction

public static double errorFunction(double x)
Error function.

Parameters:
x - Error function argument.
Returns:
Error function value.

errorFunctionComplement

public static double errorFunctionComplement(double x)
Error function complement.

Parameters:
x - Error function argument.
Returns:
Error function complement value.

errorFunctionInverse

public static double errorFunctionInverse(double z)
Inverse error function.

Parameters:
z - Probability for which matching percentage point of error function is desired.
Returns:
Error function percentage point.

The percentage point is computed using the relationship between the error function and the normal distribution.


errorFunctionInverseBad

public static double errorFunctionInverseBad(double x)
Percentage points of error function distribution.

Parameters:
x - Parameter for which percentage point is desired.
Returns:
The percentage point of the error function distribution.

The approximations used here come from in Blair, J. M. et. al., "Rational Chebyshev Approximations for the Inverse Error Function," Math Comp. Vol. 30, No. 136, Oct. 1976, pp. 827-830.


errorFunctionComplementInverseBad

public static double errorFunctionComplementInverseBad(double x)