DistributionFunction() public method

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.
return double
        public void ConstructorTest2()
        {
            var laplace = new LaplaceDistribution(location: 4, scale: 2);

            double mean = laplace.Mean;     // 4.0
            double median = laplace.Median; // 4.0
            double var = laplace.Variance;  // 8.0
            double mode = laplace.Mode;     // 4.0

            double cdf = laplace.DistributionFunction(x: 0.27); // 0.077448104942453522
            double pdf = laplace.ProbabilityDensityFunction(x: 0.27); // 0.038724052471226761
            double lpdf = laplace.LogProbabilityDensityFunction(x: 0.27); // -3.2512943611198906

            double ccdf = laplace.ComplementaryDistributionFunction(x: 0.27); // 0.92255189505754642
            double icdf = laplace.InverseDistributionFunction(p: cdf); // 0.27

            double hf = laplace.HazardFunction(x: 0.27); // 0.041974931360160776
            double chf = laplace.CumulativeHazardFunction(x: 0.27); // 0.080611649844768624

            string str = laplace.ToString(CultureInfo.InvariantCulture); // Laplace(x; μ = 4, b = 2)

            Assert.AreEqual(4.0, mean);
            Assert.AreEqual(4.0, median);
            Assert.AreEqual(8.0, var);
            Assert.AreEqual(4.0, mode);
            Assert.AreEqual(0.080611649844768624, chf);
            Assert.AreEqual(0.077448104942453522, cdf);
            Assert.AreEqual(0.038724052471226761, pdf);
            Assert.AreEqual(-3.2512943611198906, lpdf);
            Assert.AreEqual(0.041974931360160776, hf);
            Assert.AreEqual(0.92255189505754642, ccdf);
            Assert.AreEqual(0.26999999840794775, icdf);
            Assert.AreEqual("Laplace(x; μ = 4, b = 2)", str);

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

            Assert.AreEqual(-0.60517019072231026, range1.Min);
            Assert.AreEqual(8.6051701894643209, range1.Max);
            Assert.AreEqual(-3.8240460108561982, range2.Min);
            Assert.AreEqual(11.824046011144626, range2.Max);
            Assert.AreEqual(-3.8240460108561951, range3.Min);
            Assert.AreEqual(11.824046011144626, range3.Max);
        }
        public void ConstructorTest7()
        {
            var original = new LaplaceDistribution(location: 4, scale: 2);

            var laplace = GeneralContinuousDistribution.FromDensityFunction(
                original.Support, original.ProbabilityDensityFunction);

            for (double i = -10; i < +10; i += 0.1)
            {
                double expected = original.DistributionFunction(i);
                double actual = laplace.DistributionFunction(i);

                Assert.IsTrue(expected.IsRelativelyEqual(actual, 1e-5));
                Assert.IsFalse(Double.IsNaN(expected));
                Assert.IsFalse(Double.IsNaN(actual));
            }

            testLaplace(laplace);
        }
        public void DistributionFunctionTest2()
        {
            var target = GeneralizedNormalDistribution.Laplace(location: 0.42, scale: 4.2);
            var normal = new LaplaceDistribution(location: 0.42, scale: 4.2);

            for (double x = -10; x < 10; x += 0.0001)
            {
                double actual = target.DistributionFunction(x);
                double expected = normal.DistributionFunction(x);
                Assert.AreEqual(expected, actual, 1e-15);
                Assert.IsFalse(Double.IsNaN(actual));
            }
        }
        public void ConstructorTest2()
        {
            var laplace = new LaplaceDistribution(location: 4, scale: 2);

            double mean = laplace.Mean;     // 4.0
            double median = laplace.Median; // 4.0
            double var = laplace.Variance;  // 8.0

            double cdf = laplace.DistributionFunction(x: 0.27); // 0.077448104942453522
            double pdf = laplace.ProbabilityDensityFunction(x: 0.27); // 0.038724052471226761
            double lpdf = laplace.LogProbabilityDensityFunction(x: 0.27); // -3.2512943611198906

            double ccdf = laplace.ComplementaryDistributionFunction(x: 0.27); // 0.92255189505754642
            double icdf = laplace.InverseDistributionFunction(p: cdf); // 0.27

            double hf = laplace.HazardFunction(x: 0.27); // 0.041974931360160776
            double chf = laplace.CumulativeHazardFunction(x: 0.27); // 0.080611649844768624

            string str = laplace.ToString(CultureInfo.InvariantCulture); // Laplace(x; μ = 4, b = 2)

            Assert.AreEqual(4.0, mean);
            Assert.AreEqual(4.0, median);
            Assert.AreEqual(8.0, var);
            Assert.AreEqual(0.080611649844768624, chf);
            Assert.AreEqual(0.077448104942453522, cdf);
            Assert.AreEqual(0.038724052471226761, pdf);
            Assert.AreEqual(-3.2512943611198906, lpdf);
            Assert.AreEqual(0.041974931360160776, hf);
            Assert.AreEqual(0.92255189505754642, ccdf);
            Assert.AreEqual(0.26999999840794775, icdf);
            Assert.AreEqual("Laplace(x; μ = 4, b = 2)", str);
        }