public void MeanTest() { int[] values = { 1, 2, 3, 4, 5 }; var mean = StatMean.Mean(values); Assert.AreEqual(3, mean); }
public void MeanDoubleTest() { double[] values = { 1.3, 2.1, 3.7, 4.5, 5.8 }; var mean = StatMean.Mean(values); Assert.AreEqual(3.48, mean); }
public void MeanDoubleTest() { double[] values = { 1.1, 2.4, 3.6, 4.8, 5.5 }; var mean = StatMean.Mean(values); Assert.AreEqual(3.48, mean); }
public static double Variance(dynamic values) { double mean = StatMean.Mean(values); double[] squDev = new double[Helpers.Arrays.Length(values)]; int i = 0; foreach (int a in values) { squDev[i] = Square.Square.Squared(Subtraction.Difference(a, mean)); i++; } double variance = StatMean.Mean(squDev); return(variance); }
public dynamic Mean(dynamic values) { solution = StatMean.Mean(values); return(solution); }