示例#1
0
        public void ValidateDensity(double scale, double shape, double x, double expected)
        {
            var dist = new Pareto(scale, shape);

            Assert.AreEqual(expected, dist.Density(x), 1e-12);
            Assert.AreEqual(expected, Pareto.PDF(scale, shape, x), 1e-12);

            Assert.AreEqual(Math.Log(expected), dist.DensityLn(x), 1e-12);
            Assert.AreEqual(Math.Log(expected), Pareto.PDFLn(scale, shape, x), 1e-12);
        }