public void StandardDeviationTest2() { double[] values = { -5, 0.2, 2 }; double expected = 3.6350149013908224; double actual = Tools.StandardDeviation(values); Assert.AreEqual(expected, actual); }
public void StandardDeviationTest3() { double[,] matrix = { { 2, -1.0, 5 }, { 7, 0.5, 9 }, }; double[] means = Tools.Mean(matrix); Assert.IsTrue(means.IsEqual(4.5000, -0.2500, 7.0000)); double[] stdev = Tools.StandardDeviation(matrix, means); Assert.IsTrue(stdev.IsEqual(3.5355339059327378, 1.0606601717798212, 2.8284271247461903)); double[] stdev2 = Tools.StandardDeviation(matrix); Assert.IsTrue(stdev2.IsEqual(stdev)); }