if there isn't any easy way.. how can i utilize this code?
public static double StandardDeviation(List
{ double M = 0.0;
double S = 0.0;
int k = 1;
foreach (double value in valueList)
{ double tmpM = M;
M += (value - tmpM) / k;
S += (value - tmpM) * (value - M);
k++;
}
return Math.Sqrt(S / (k-2));
}
Replies
Know the answer? Post it — somebody with the same question will find it here.