Example #1
0
        public void ValidateCumulativeDistribution(double location, double scale, double x)
        {
            var    n        = new Laplace(location, scale);
            double expected = 0.5 * (1.0 + (Math.Sign(x - location) * (1.0 - Math.Exp(-Math.Abs(x - location) / scale))));

            Assert.AreEqual(expected, n.CumulativeDistribution(x));
            Assert.AreEqual(expected, Laplace.CDF(location, scale, x));
        }