12 #include <gtest/gtest.h>
19 const double eps = 1e-12;
21 TEST(distributions, normalPDF_1d)
29 TEST(distributions, normalPDF_vector)
31 const double cov_vals[3 * 3] = {4.0, 2.0, 1.0, 2.0, 3.0,
33 const double x1_vals[3] = {1.0, 0.0, 0.0};
34 const double x2_vals[3] = {1.0, 2.0, 3.0};
42 normalPDF(x0, x0, COV), 0.02592116832548877620,
45 normalPDF(x2, x2, COV), 0.02592116832548877620,
49 normalPDF(x1, x0, COV), 0.02061240910323311470,
52 normalPDF(x2, x0, COV), 0.00008423820480102986,
56 normalPDF(x1, COV), 0.02061240910323311470,
59 normalPDF(x2, COV), 0.00008423820480102986,
65 const double eps2 = 1e-7;
67 EXPECT_NEAR(std::erfc(0), 1,
eps);
68 EXPECT_NEAR(std::erfc(1), 0.157299207050285, eps2);
69 EXPECT_NEAR(std::erfc(2), 0.004677734981047, eps2);
74 const double eps2 = 1e-7;
76 EXPECT_NEAR(std::erf(0), 0,
eps);
77 EXPECT_NEAR(std::erf(1), 0.842700792949715, eps2);
78 EXPECT_NEAR(std::erf(2), 0.995322265018953, eps2);
108 const double eps2 = 1e-7;