Accord.Math.Normal.Complemented C# (CSharp) Method

Complemented() public static method

Complemented cumulative distribution function.
public static Complemented ( double value ) : double
value double
return double
        public static double Complemented(double value)
        {
            return 0.5 * Special.Erfc(value / Constants.Sqrt2);
        }

Usage Example

コード例 #1
0
        /// <summary>
        ///   Computes Owen's T function for arbitrary H and A.
        /// </summary>
        ///
        /// <param name="h">Owen's T function argument H.</param>
        /// <param name="a">Owen's T function argument A.</param>
        ///
        /// <returns>The value of Owen's T function.</returns>
        ///
        public static double Function(double h, double a)
        {
            double       absa;
            double       absh;
            double       ah;
            const double cut = 0.67;
            double       normah;
            double       normh;
            double       value;

            absh = Math.Abs(h);
            absa = Math.Abs(a);
            ah   = absa * absh;

            if (absa <= 1.0)
            {
                value = Function(absh, absa, ah);
            }
            else if (absh <= cut)
            {
                value = 0.25 - (-0.5 + Normal.Function(absh)) * (-0.5 + Normal.Function(ah))
                        - Function(ah, 1.0 / absa, absh);
            }
            else
            {
                normh  = Normal.Complemented(absh);
                normah = Normal.Complemented(ah);
                value  = 0.5 * (normh + normah) - normh * normah
                         - Function(ah, 1.0 / absa, absh);
            }

            if (a < 0.0)
            {
                value = -value;
            }

            return(value);
        }
All Usage Examples Of Accord.Math.Normal::Complemented