Exemplo n.º 1
0
        public static double StatZScore(dynamic score, dynamic values)
        {
            double mean     = StatisticMean.Mean(values);
            double standDev = StatsStandardDev.StandardDev(values);
            double zScore   = Division.Quotient(Subtraction.Subtract(score, mean), standDev);

            return(zScore);
        }
Exemplo n.º 2
0
        public static double Variance(dynamic values)
        {
            double mean       = StatisticMean.Mean(values);
            double difference = 0;
            double variance   = 0;

            foreach (int a in values)
            {
                difference = Subtraction.Subtract((int)mean, a);
                difference = Math.Pow(difference, 2);
                variance   = Addition.Sum(variance, (int)difference);
            }
            int ValueCount = Helpers.Arrays.Length(values);

            variance = Division.Quotient(variance, ValueCount);
            return(variance);
        }