sparkz
sparkz copied to clipboard
Bug in StatsCounter
Hi Gianmario, The stats counter has a bug when computing the variance. Var(x) = 1/n * Sum i=1:n [ (x_i - miu)^2] = 1/n * Sum i=1:n (Xi^2 - 2 * Xi * miu - miu^2) = = 1/n * SumOfSquares(X) - 2 * miu / n * SUM(X) + miu^2.
In your implementation you are missing the term 2 * miu * Sum(X).