public void LogProductNormalizationTests() { var standardNormal = new GaussianDistribution(0, 1); var lpn = GaussianDistribution.LogProductNormalization(standardNormal, standardNormal); Assert.AreEqual(-1.2655121234846454, lpn, ErrorTolerance); var m1s2 = new GaussianDistribution(1, 2); var m3s4 = new GaussianDistribution(3, 4); var lpn2 = GaussianDistribution.LogProductNormalization(m1s2, m3s4); Assert.AreEqual(-2.5168046699816684, lpn2, ErrorTolerance); }
public static void TestLogProductNormalization() { // Verified with Ralf Herbrich's F# implementation var standardNormal = new GaussianDistribution(0, 1); var lpn = GaussianDistribution.LogProductNormalization(standardNormal, standardNormal); Assert.AreEqual(-1.2655121234846454, lpn, ErrorTolerance); var m1s2 = new GaussianDistribution(1, 2); var m3s4 = new GaussianDistribution(3, 4); var lpn2 = GaussianDistribution.LogProductNormalization(m1s2, m3s4); Assert.AreEqual(-2.5168046699816684, lpn2, ErrorTolerance); }