Accord.Statistics.Distributions.Univariate.NormalDistribution.DistributionFunction C# (CSharp) Method

DistributionFunction() public method

Gets the cumulative distribution function (cdf) for the this distribution evaluated at point x.

The Cumulative Distribution Function (CDF) describes the cumulative probability that a given value or any value smaller than it will occur.

The calculation is computed through the relationship to the function as erfc(-z/sqrt(2)) / 2.

References: http://mathworld.wolfram.com/NormalDistributionFunction.html

public DistributionFunction ( double x ) : double
x double /// A single point in the distribution range.
return double
        public override double DistributionFunction(double x)
        {
            double z = ZScore(x);
            return Special.Erfc(-z/Special.Sqrt2)/2.0;
        }

Usage Example

        /// <summary>
        ///   Gets the cumulative distribution function (cdf) for
        ///   this distribution evaluated at point <c>k</c>.
        /// </summary>
        ///
        /// <param name="x">A single point in the distribution range.</param>
        ///
        /// <remarks>
        ///   The Cumulative Distribution Function (CDF) describes the cumulative
        ///   probability that a given value or any value smaller than it will occur.
        /// </remarks>
        ///
        protected internal override double InnerDistributionFunction(double x)
        {
            if (this.exact)
            {
                return(exactMethod(x, table));
            }

            if (Correction == ContinuityCorrection.Midpoint)
            {
                if (x > Mean)
                {
                    x = x - 0.5;
                }
                else
                {
                    x = x + 0.5;
                }
            }
            else if (Correction == ContinuityCorrection.KeepInside)
            {
                x = x + 0.5;
            }

            return(approximation.DistributionFunction(x));
        }
All Usage Examples Of Accord.Statistics.Distributions.Univariate.NormalDistribution::DistributionFunction