gov.sandia.cognition.statistics.distribution
Class UnivariateGaussian.ErrorFunction

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.math.AbstractScalarFunction<Double>
          extended by gov.sandia.cognition.math.AbstractUnivariateScalarFunction
              extended by gov.sandia.cognition.statistics.distribution.UnivariateGaussian.ErrorFunction
All Implemented Interfaces:
Evaluator<Double,Double>, ScalarFunction<Double>, UnivariateScalarFunction, CloneableSerializable, Serializable, Cloneable
Enclosing class:
UnivariateGaussian

@PublicationReference(title="ErrorFunction.java",
                      author={"Robert Sedgewick","Kevin Wayne"},
                      type=WebPage,
                      year=2007,
                      url="http://www.cs.princeton.edu/introcs/21function/ErrorFunction.java.html")
public static class UnivariateGaussian.ErrorFunction
extends AbstractUnivariateScalarFunction

Gaussian Error Function, useful for computing the cumulative distribution function for a Gaussian. This implementation uses Horner's method of approximation.

See Also:
Serialized Form

Nested Class Summary
static class UnivariateGaussian.ErrorFunction.Inverse
          Inverse of the ErrorFunction
 
Field Summary
static UnivariateGaussian.ErrorFunction INSTANCE
          Default instance.
 
Constructor Summary
UnivariateGaussian.ErrorFunction()
          Default constructor.
 
Method Summary
 double evaluate(double z)
          Computes the Gaussian Error Function using Horner's Method.
 
Methods inherited from class gov.sandia.cognition.math.AbstractUnivariateScalarFunction
evaluate, evaluateAsDouble
 
Methods inherited from class gov.sandia.cognition.util.AbstractCloneableSerializable
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.util.CloneableSerializable
clone
 

Field Detail

INSTANCE

public static final UnivariateGaussian.ErrorFunction INSTANCE
Default instance.

Constructor Detail

UnivariateGaussian.ErrorFunction

public UnivariateGaussian.ErrorFunction()
Default constructor.

Method Detail

evaluate

public double evaluate(double z)
Computes the Gaussian Error Function using Horner's Method. Guaranteed to be accurate within 1.2E-7, but can suffer from catastrophic cancellation when z is close to 0.0

Parameters:
z - value on the interval (-infinity,infinity)
Returns:
Normalized Gaussian Error Function value of z