Beyond_Beyaan.Utility.NormalCDFInverse C# (CSharp) 메소드

NormalCDFInverse() 개인적인 정적인 메소드

private static NormalCDFInverse ( double p ) : double
p double
리턴 double
        private static double NormalCDFInverse(double p)
        {
            if (p <= 0.0 || p >= 1.0)
            {
                string msg = String.Format("Invalid input argument: {0}.", p);
                throw new ArgumentOutOfRangeException(msg);
            }

            // See article above for explanation of this section.
            if (p < 0.5)
            {
                // F^-1(p) = - G^-1(p)
                return -RationalApproximation(Math.Sqrt(-2.0 * Math.Log(p)));
            }
            // F^-1(p) = G^-1(1-p)
            return RationalApproximation(Math.Sqrt(-2.0 * Math.Log(1.0 - p)));
        }