DistributionFunction() public méthode

Gets the cumulative distribution function (cdf) for 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.
public DistributionFunction ( double x ) : double
x double A single point in the distribution range.
Résultat double
        public void ConstructorTest()
        {
            var ks = new KolmogorovSmirnovDistribution(samples: 42);

            double mean = ks.Mean;     // 0.13404812830261556
            double median = ks.Median;   // 0.12393613519421857
            double var = ks.Variance; // 0.019154717445778062

            double cdf = ks.DistributionFunction(x: 0.27); // 0.99659863602996079

            double ccdf = ks.ComplementaryDistributionFunction(x: 0.27); // 0.0034013639700392062
            double icdf = ks.InverseDistributionFunction(p: cdf); // 0.26999997446092017

            double chf = ks.CumulativeHazardFunction(x: 0.27); // 5.6835787601476619

            string str = ks.ToString(); // "KS(x; n = 42)"

            Assert.AreEqual(0.13404812830261556, mean);
            Assert.AreEqual(0.12393613519421857, median, 1e-6);
            Assert.AreEqual(0.019154717445778062, var);
            Assert.AreEqual(5.6835787601476619, chf);
            Assert.AreEqual(0.99659863602996079, cdf);
            Assert.AreEqual(0.0034013639700392062, ccdf);
            Assert.AreEqual(0.27, icdf, 1e-6);
            Assert.AreEqual("KS(x; n = 42)", str);
        }
        public void ConstructorTest()
        {
            var ks = new KolmogorovSmirnovDistribution(samples: 42);

            double mean = ks.Mean;     // 0.13404812830261556
            double median = ks.Median;   // 0.12393613519421857
            double var = ks.Variance; // 0.019154717445778062

            try { double mode = ks.Mode; Assert.Fail(); }
            catch { }

            double cdf = ks.DistributionFunction(x: 0.27); // 0.99659863602996079

            double ccdf = ks.ComplementaryDistributionFunction(x: 0.27); // 0.0034013639700392062
            double icdf = ks.InverseDistributionFunction(p: cdf); // 0.26999997446092017

            double chf = ks.CumulativeHazardFunction(x: 0.27); // 5.6835787601476619

            string str = ks.ToString(); // "KS(x; n = 42)"

            Assert.AreEqual(0.13404812830261556, mean);
            Assert.AreEqual(0.12393613519421857, median, 1e-6);
            Assert.AreEqual(0.019154717445778062, var);
            Assert.AreEqual(5.6835787601476619, chf);
            Assert.AreEqual(0.99659863602996079, cdf);
            Assert.AreEqual(0.0034013639700392062, ccdf);
            Assert.AreEqual(0.27, icdf, 1e-6);
            Assert.AreEqual("KS(x; n = 42)", str);

            var range1 = ks.GetRange(0.95);
            var range2 = ks.GetRange(0.99);
            var range3 = ks.GetRange(0.01);

            Assert.AreEqual(0.076658557134805502, range1.Min);
            Assert.AreEqual(0.20517007413251875, range1.Max);
            Assert.AreEqual(0.064613698945741663, range2.Min);
            Assert.AreEqual(0.24612731591151149, range2.Max);
            Assert.AreEqual(0.064613698945741649, range3.Min);
            Assert.AreEqual(0.24612731591151149, range3.Max);
        }
        public void NaN_Test()
        {
            var ks = new KolmogorovSmirnovDistribution(samples: 42);

            double nan = double.NaN;

            try
            {
                ks.DistributionFunction(x: nan);
                Assert.Fail();
            }
            catch (ArgumentOutOfRangeException) { }

            try
            {
                ks.ComplementaryDistributionFunction(x: nan);
                Assert.Fail();
            }
            catch (ArgumentOutOfRangeException) { }

            try
            {
                ks.InverseDistributionFunction(p: nan);
                Assert.Fail();
            }
            catch (ArgumentOutOfRangeException) { }
            try
            {
                ks.CumulativeHazardFunction(x: nan);
                Assert.Fail();
            }
            catch (ArgumentOutOfRangeException) { }

        }