Пример #1
0
        public void MeanTest()
        {
            int[] values = { 1, 2, 3, 4, 5 };
            var   mean   = StatMean.Mean(values);

            Assert.AreEqual(3, mean);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }
Пример #5
0
 public dynamic Mean(dynamic values)
 {
     solution = StatMean.Mean(values);
     return(solution);
 }