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); }
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); }