public void AbsoluteDifferenceTests() { var standardNormal = new GaussianDistribution(0, 1); var absDiff = GaussianDistribution.AbsoluteDifference(standardNormal, standardNormal); Assert.AreEqual(0.0, absDiff, ErrorTolerance); var m1s2 = new GaussianDistribution(1, 2); var m3s4 = new GaussianDistribution(3, 4); var absDiff2 = GaussianDistribution.AbsoluteDifference(m1s2, m3s4); Assert.AreEqual(0.4330127018922193, absDiff2, ErrorTolerance); }
public static void TestAbsoluteDifference() { // Verified with Ralf Herbrich's F# implementation var standardNormal = new GaussianDistribution(0, 1); var absDiff = GaussianDistribution.AbsoluteDifference(standardNormal, standardNormal); Assert.AreEqual(0.0, absDiff, ErrorTolerance); var m1s2 = new GaussianDistribution(1, 2); var m3s4 = new GaussianDistribution(3, 4); var absDiff2 = GaussianDistribution.AbsoluteDifference(m1s2, m3s4); Assert.AreEqual(0.4330127018922193, absDiff2, ErrorTolerance); }