Class MathFunctions


  • public class MathFunctions
    extends Object
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  MathFunctions.Metric  
    • Constructor Summary

      Constructors 
      Constructor Description
      MathFunctions()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static long factorial​(int n)  
      static double normInv​(double p)
      Original C++ implementation found at http://www.wilmott.com/messageview.cfm?catid=10&threadid=38771 C# implementation found at http://weblogs.asp.net/esanchez/archive/2010/07/29/a-quick-and-dirty-implementation-of-excel-norminv-function-in-c.aspx Compute the quantile function for the normal distribution.
      static double normInv​(double p, double mu, double sigma)  
    • Constructor Detail

      • MathFunctions

        public MathFunctions()
    • Method Detail

      • factorial

        public static long factorial​(int n)
      • normInv

        public static double normInv​(double p,
                                     double mu,
                                     double sigma)
        Parameters:
        p - p
        mu - mu
        sigma - sigma
        Returns:
        z-score
      • normInv

        public static double normInv​(double p)
        Original C++ implementation found at http://www.wilmott.com/messageview.cfm?catid=10&threadid=38771 C# implementation found at http://weblogs.asp.net/esanchez/archive/2010/07/29/a-quick-and-dirty-implementation-of-excel-norminv-function-in-c.aspx Compute the quantile function for the normal distribution. For small to moderate probabilities, algorithm referenced below is used to obtain an initial approximation which is polished with a final Newton step. For very large arguments, an algorithm of Wichura is used. REFERENCE Beasley, J. D. and S. G. Springer (1977). Algorithm AS 111: The percentage points of the normal distribution, Applied Statistics, 26, 118-121. Wichura, M.J. (1988). Algorithm AS 241: The Percentage Points of the Normal Distribution. Applied Statistics, 37, 477-484.
        Parameters:
        p - p
        Returns:
        z-score