コード例 #1
0
 def test_equal_one_dimensional_gaussians(self):
     meanA = np.array([3], dtype=float)
     covA = np.array([3], dtype=float)
     meanB = np.array([3], dtype=float)
     covB = np.array([3.00001], dtype=float)
     first_gaussian = Gaussian(meanA, covA)
     second_gaussian = Gaussian(meanB, covB)
     self.assertTrue(first_gaussian.is_equal_to(second_gaussian, tolerance=0.0001))
コード例 #2
0
 def test_equal_three_dimensional_gaussians_with_too_small_tolerance(self):
     meanA = np.array([3, 5, 4], dtype=float)
     covA = np.array([10, 20, 40], dtype=float)
     meanB = np.array([3, 5.000001, 3.999999], dtype=float)
     covB = np.array([10.001, 20, 40], dtype=float)
     first_gaussian = Gaussian(meanA, covA)
     second_gaussian = Gaussian(meanB, covB)
     self.assertFalse(first_gaussian.is_equal_to(second_gaussian, tolerance=0.0001))
コード例 #3
0
 def test_equal_of_two_gaussians_with_different_dimensions(self):
     meanA = np.array([3], dtype=float)
     covA = np.array([10], dtype=float)
     meanB = np.array([3, 5.000001, 3.999999], dtype=float)
     covB = np.array([10.00001, 20, 40], dtype=float)
     first_gaussian = Gaussian(meanA, covA)
     second_gaussian = Gaussian(meanB, covB)
     self.assertFalse(first_gaussian.is_equal_to(second_gaussian, tolerance=0.0001))
コード例 #4
0
 def test_equal_two_dimensional_gaussians_with_too_small_tolerance(self):
     meanA = np.array([3, 5], dtype=float)
     covA = np.array([3, 2], dtype=float)
     meanB = np.array([3, 5.1], dtype=float)
     covB = np.array([3.00001, 2], dtype=float)
     first_gaussian = Gaussian(meanA, covA)
     second_gaussian = Gaussian(meanB, covB)
     self.assertFalse(first_gaussian.is_equal_to(second_gaussian, tolerance=0.0001))