Algorithm is described [here](http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Online_algorithm).
Algorithm is described here.