13 #include <gtest/gtest.h> 21 const double eps = 1e-12;
23 TEST(distributions,normalPDF_1d)
31 TEST(distributions,normalPDF_vector)
33 const double cov_vals [3*3] = {
38 const double x1_vals[3] = {1.0, 0.0, 0.0};
39 const double x2_vals[3] = {1.0, 2.0, 3.0};
46 EXPECT_NEAR(
normalPDF(x0,x0,COV), 0.02592116832548877620,
eps);
47 EXPECT_NEAR(
normalPDF(x2,x2,COV), 0.02592116832548877620,
eps);
49 EXPECT_NEAR(
normalPDF(x1,x0,COV), 0.02061240910323311470,
eps);
50 EXPECT_NEAR(
normalPDF(x2,x0,COV), 0.00008423820480102986,
eps);
52 EXPECT_NEAR(
normalPDF(x1,COV), 0.02061240910323311470,
eps);
53 EXPECT_NEAR(
normalPDF(x2,COV), 0.00008423820480102986,
eps);
58 const double eps2 = 1e-7;
67 const double eps2 = 1e-7;
101 const double eps2 = 1e-7;
A namespace of pseudo-random numbers genrators of diferent distributions.
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
TEST(distributions, normalPDF_1d)
double BASE_IMPEXP normalCDF(double p)
Evaluates the Gaussian cumulative density function.
double BASE_IMPEXP erfc(const double x)
The complementary error function of a Normal distribution.
This base provides a set of functions for maths stuff.
double BASE_IMPEXP erf(const double x)
The error function of a Normal distribution.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
double BASE_IMPEXP chi2inv(double P, unsigned int dim=1)
The "quantile" of the Chi-Square distribution, for dimension "dim" and probability 0<P<1 (the inverse...
std::pair< double, double > BASE_IMPEXP noncentralChi2PDF_CDF(unsigned int degreesOfFreedom, double noncentrality, double arg, double eps=1e-7)
Returns the 'exact' PDF (first) and CDF (second) of a Non-central chi-squared probability distributio...
double BASE_IMPEXP normalPDF(double x, double mu, double std)
Evaluates the univariate normal (Gaussian) distribution at a given point "x".
double BASE_IMPEXP chi2PDF(unsigned int degreesOfFreedom, double arg, double accuracy=1e-7)