[mlpack-git] master: cov matrices should be symmetric- fixes error in gaussian test case (5405d31)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Wed Feb 4 13:59:59 EST 2015


Repository : https://github.com/mlpack/mlpack

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/b4c08074ca03feaf38511e62fd0e928330b99d93...5405d315de3db90fb652b13441f68c2c482286f3

>---------------------------------------------------------------

commit 5405d315de3db90fb652b13441f68c2c482286f3
Author: Stephen Tu <tu.stephenl at gmail.com>
Date:   Wed Feb 4 10:56:16 2015 -0800

    cov matrices should be symmetric- fixes error in gaussian test case


>---------------------------------------------------------------

5405d315de3db90fb652b13441f68c2c482286f3
 src/mlpack/tests/distribution_test.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/mlpack/tests/distribution_test.cpp b/src/mlpack/tests/distribution_test.cpp
index c5d9ced..f4f6b50 100644
--- a/src/mlpack/tests/distribution_test.cpp
+++ b/src/mlpack/tests/distribution_test.cpp
@@ -240,18 +240,18 @@ BOOST_AUTO_TEST_CASE(GaussianMultivariateProbabilityTest)
   BOOST_REQUIRE_CLOSE(g.Probability(-x), 0.0795774715459477, 1e-5);
 
   g.Mean() = "1 1";
-  covariance = "2 1.5; 1 4";
+  covariance = "2 1.5; 1.5 4";
   g.Covariance(std::move(covariance));
 
-  BOOST_REQUIRE_CLOSE(g.Probability(x), 0.060154914192541771, 1e-5);
+  BOOST_REQUIRE_CLOSE(g.Probability(x), 0.066372199406187285, 1e-5);
   g.Mean() *= -1;
-  BOOST_REQUIRE_CLOSE(g.Probability(-x), 0.060154914192541771, 1e-5);
+  BOOST_REQUIRE_CLOSE(g.Probability(-x), 0.066372199406187285, 1e-5);
 
   g.Mean() = "1 1";
   x = "-1 4";
 
-  BOOST_REQUIRE_CLOSE(g.Probability(x), 0.0022506270186086271, 1e-5);
-  BOOST_REQUIRE_CLOSE(g.Probability(-x), 0.0016912950996661141, 1e-5);
+  BOOST_REQUIRE_CLOSE(g.Probability(x), 0.00072147262356379415, 1e-5);
+  BOOST_REQUIRE_CLOSE(g.Probability(-x), 0.00085851785428674523, 1e-5);
 
   // Higher-dimensional case.
   x = "0 1 2 3 4";



More information about the mlpack-git mailing list