Accord.Statistics.Distributions.Univariate.ShapiroWilkDistribution.ComplementaryDistributionFunction C# (CSharp) Method

ComplementaryDistributionFunction() public method

Gets the complementary cumulative distribution function (ccdf) for this distribution evaluated at point x. This function is also known as the Survival function.
The Complementary Cumulative Distribution Function (CCDF) is the complement of the Cumulative Distribution Function, or 1 minus the CDF.
public ComplementaryDistributionFunction ( double x ) : double
x double A single point in the distribution range.
return double
        public override double ComplementaryDistributionFunction(double x)
        {
            if (x <= 0) return 0;
            if (x >= 1) return 1;

            double z = g(x);
            return normal.ComplementaryDistributionFunction(z);
        }

Usage Example

        public void ConstructorTest()
        {
            // Example from http://www.nag.com/numeric/cl/nagdoc_cl23/pdf/G01/g01ddc.pdf

            double[] a = 
            { 
                0.11, 7.87, 4.61, 10.14, 7.95, 3.14, 0.46, 4.43, 
                0.21, 4.75, 0.71, 1.52, 3.24, 0.93, 0.42, 4.97,
                9.53, 4.55, 0.47, 6.66 
            };

            var sw = new ShapiroWilkDistribution(a.Length);

            double expected = 0.0421;
            double actual = sw.ComplementaryDistributionFunction(0.9005);
            Assert.AreEqual(expected, actual, 1e-4);
        }
All Usage Examples Of Accord.Statistics.Distributions.Univariate.ShapiroWilkDistribution::ComplementaryDistributionFunction