1 | initial version |
Yes.
Std-dev is the root of the variance. The variance can be defined as:
the-mean-of-square-values minus the-square-of-the-value-mean.
Thus, you can keep 3 running values:
n
;m_x
; m_xx
.The variance is then: float var = (m_xx - m_x)/n;
The std-dev is thus: float stddev = sqrt(var);
.