Class CDF_Normal

java.lang.Object
velo.ladaalpha.fields.math.stats.CDF_Normal

public class CDF_Normal extends Object
This class contains routines to calculate the normal cumulative distribution function (CDF) and its inverse.
Version:
.5 --- June 7, 1996, .6 --- January 10, 2001 (normcdf added)
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    normp(double z)
    This method calculates the normal cumulative distribution function.
    static double
    xnormi(double p)
    This method calculates the normal cdf inverse function.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CDF_Normal

      public CDF_Normal()
  • Method Details

    • xnormi

      public static double xnormi(double p)
      This method calculates the normal cdf inverse function.

      Let PHI(x) be the normal cdf. Suppose that Q calculates 1.0 - PHI(x), and that QINV calculates QINV(p) for p in (0.0,.5]. Then for p .le. .5, x = PHIINV(p) = -QINV(p). For p .gt. .5, x = PHIINV(p) = QINV(1.0 - p). The formula for approximating QINV is taken from Abramowitz and Stegun, Handbook of Mathematical Functions, Dover, 9th printing, formula 26.2.3, page 933. The error in x is claimed to be less than 4.5e-4 in absolute value.

      Parameters:
      p - the p
      Returns:
      the double
    • normp

      public static double normp(double z)
      This method calculates the normal cumulative distribution function.

      It is based upon algorithm 5666 for the error function, from:

             Hart, J.F. et al, 'Computer Approximations', Wiley 1968
       

      The FORTRAN programmer was Alan Miller. The documentation in the FORTRAN code claims that the function is "accurate to 1.e-15."

      Steve Verrill translated the FORTRAN code (the March 30, 1986 version) into Java. This translation was performed on January 10, 2001.

      Parameters:
      z - the z
      Returns:
      the double