Exemple #1
0
        public static double ZScore(dynamic score, dynamic values)
        {
            double mean     = StatsMean.Mean(values);
            double standDev = StatsStandardDev.StandardDev(values);
            double zScore   = Division.Quotient(Subtraction.Subtract(score, mean), standDev);

            return(zScore);
        }
Exemple #2
0
        public static double Variance(dynamic values)
        {
            double mean = StatsMean.Mean(values);

            double[] squaredDeviation = new double[Helpers.Arrays.Length(values)];;
            int      i = 0;

            foreach (int a in values)
            {
                squaredDeviation[i] = (Subtraction.Subtract(a, mean));
                i++;
            }
            double variance = StatsMean.Mean(squaredDeviation);

            return(variance);
        }