I want to calculate mean
,std
, skewness
, kurtosis
and covariance
using one pass algorithms. The simplest and fastest one approach I found was published by Stuart McCrary from Berkeley Research Group. For example for std
one may use:
std = sqrt((sum(x^2)-N*mean(X)^2)/(N-1))
I read that this approach is not good enough, as it is numerically unstable. Unfortunately, I have no deep understanding of numerical stability, but as I understand it is some problem, which happens because of limited precision of floating points operations.
In my case, I will deal only with integer numbers from 10^1-10^6
range.
May I use this approach in my case and do not take care about numerical stability?