public void BhattacharyyaTest2() { double[] x = { 2, 0, 0 }; double[] y = { 1, 0, 0 }; double[,] covX = { { 2, 3, 0 }, { 3, 0, 0 }, { 0, 0, 0 } }; double[,] covY = { { 2, 1, 0 }, { 1, 0, 0 }, { 0, 0, 0 } }; // Run actual test double expected = 0.1438410362258904; double actual = Distance.Bhattacharyya(x, covX, y, covY); Assert.AreEqual(expected, actual, 1e-6); Assert.IsFalse(Double.IsNaN(actual)); }
public void BhattacharyyaTest1() { double[] histogram1 = { 0.1, 0.5, 0.4 }; double[] histogram2 = { 0.7, 0.2, 0.1 }; double expected = 0.468184902444219; double actual = Distance.Bhattacharyya(histogram1, histogram2); Assert.AreEqual(expected, actual, 1e-10); Assert.IsFalse(Double.IsNaN(actual)); }
public void BhattacharyyaTest4() { double[,] X = { { 0.20, 0.52 }, { 1.52, 2.53 }, { 7.21, 0.92 }, }; double expected = 0.0; double actual = Distance.Bhattacharyya(X, X); Assert.AreEqual(expected, actual, 1e-10); Assert.IsFalse(Double.IsNaN(actual)); }
public void BhattacharyyaTest() { double[,] X = { { 0.20, 0.52 }, { 1.52, 2.53 }, { 7.21, 0.92 }, }; double[,] Y = { { 9.42, 5.21 }, { 1.12, 3.14 }, { 5.21, 2.12 }, }; double expected = 0.450958210666019; double actual = Distance.Bhattacharyya(X, Y); Assert.AreEqual(expected, actual, 1e-10); }