public void estimate_gaussian_distances()
{
Accord.Math.Random.Generator.Seed = 0;
double[][] data =
{
new double[] { 5.1, 3.5, 1.4, 0.2 },
new double[] { 5.0, 3.6, 1.4, 0.2 },
new double[] { 4.9, 3.0, 1.4, 0.2 },
new double[] { 5.8, 4.0, 1.2, 0.2 },
new double[] { 4.7, 3.2, 1.3, 0.2 },
};
var actual = Gaussian.Distances(data, 2);
Assert.IsTrue(actual.IsSorted());
Assert.AreEqual(0.95, actual.Mean(), 1e-5);
actual = Gaussian.Distances(data, data.Length);
Assert.IsTrue(actual.IsSorted());
Assert.AreEqual(0.5296, actual.Mean(), 1e-5);
Assert.Throws<ArgumentOutOfRangeException>(() => Gaussian.Distances(data, 10));
}