sparkz icon indicating copy to clipboard operation
sparkz copied to clipboard

Bug in StatsCounter

Open vicpara opened this issue 7 years ago • 0 comments

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).

vicpara avatar Mar 17 '17 11:03 vicpara