public static double ZScore(dynamic score, dynamic values) { double mean = StatMean.Mean(values); double standDev = StatStandardDev.StandDev(values); double zScore = Division.Quotient(Subtraction.Difference(score, mean), standDev); return(zScore); }
public static double Variance(dynamic values) { double mean = StatMean.Mean(values); double[] squaredDeviation = new double[Helpers.Array.Length(values)]; int i = 0; foreach (int a in values) { squaredDeviation[i] = Square.Squared(Subtraction.Minus(a, mean)); i++; } double variance = StatMean.Mean(squaredDeviation); return(variance); }