public void KDETestGaussianKernelBandwidth2() { var estimate = KernelDensity.EstimateGaussian(-3.5d, 2.0d, _testData); AssertHelpers.AlmostEqualRelative(0.046875864115900, estimate, 10); estimate = KernelDensity.EstimateGaussian(0.0d, 2.0d, _testData); AssertHelpers.AlmostEqualRelative(0.186580447512078, estimate, 10); estimate = KernelDensity.EstimateGaussian(2.0d, 2.0d, _testData); AssertHelpers.AlmostEqualRelative(0.123339405007761, estimate, 10); }
public void KDETestGaussianKernelBandwidth0p5() { var estimate = KernelDensity.EstimateGaussian(-3.5d, 0.5d, _testData); AssertHelpers.AlmostEqualRelative(5.311490430807364e-007, estimate, 10); estimate = KernelDensity.EstimateGaussian(0.0d, 0.5d, _testData); AssertHelpers.AlmostEqualRelative(0.369994803886827, estimate, 10); estimate = KernelDensity.EstimateGaussian(2.0d, 0.5d, _testData); AssertHelpers.AlmostEqualRelative(0.032447347007482, estimate, 10); }
public void KDETestGaussianKernelBandwidth1() { //Density of standard normal distribution at 0 AssertHelpers.AlmostEqualRelative(0.398942280401433, KernelDensity.GaussianKernel(0), 10); var estimate = KernelDensity.EstimateGaussian(-3.5d, 1.0d, _testData); AssertHelpers.AlmostEqualRelative(0.004115405028907, estimate, 10); estimate = KernelDensity.EstimateGaussian(0.0d, 1.0d, _testData); AssertHelpers.AlmostEqualRelative(0.310485907659139, estimate, 10); estimate = KernelDensity.EstimateGaussian(2.0d, 1.0d, _testData); AssertHelpers.AlmostEqualRelative(0.099698581377801, estimate, 10); }