Derivation of Running(Online) Variance's formula I need to know the dimostration of Running Variance's formula: $$ \sigma_n^2 =\frac{(n-1)\sigma_{n-1}^{2}+(x_n-\overline{x}_{n-1})\cdot(x_n-\overline{x}_{n})}{n} $$
 A: With the definition $Q_n= n\sigma_n^2\,$ we have to show 
$$Q_n- Q_{n-1} = (x_n-\bar{x}_{n-1})\cdot(x_n-\bar{x}_n).$$
Firstly derive a formula for $Q_n:$
$$Q_n = \sum_{i=1}^n(x_i-\bar{x}_n)^2=\sum_{i=1}^n(x_i^2-2 x_i\bar{x}_n +\bar{x}_n^2)\\
= \sum_{i=1}^n x_i^2- 2\bar{x}_n \sum_{i=1}^nx_i + \sum_{i=1}^n\bar{x}_n^2\\
= \sum_{i=1}^n x_i^2- 2\bar{x}_n (n\bar{x}_n) + n\bar{x}_n^2\\
= \sum_{i=1}^n x_i^2- n\bar{x}_n^2$$ 
then start computing the difference
$$Q_n- Q_{n-1} = \sum_{i=1}^n x_i^2- n\bar{x}_n^2 - \sum_{i=1}^{n-1} x_i^2+(n-1)\bar{x}_{n-1}^2\\
= x_n^2 - n\bar{x}_n^2 + (n-1)\bar{x}_{n-1}^2\\
= x_n^2 - \bar{x}_{n-1}^2 + n(\bar{x}_{n-1}^2-\bar{x}_{n}^2)\\
=x_n^2 - \bar{x}_{n-1}^2 + n(\bar{x}_{n-1}-\bar{x}_{n})(\bar{x}_{n-1}+\bar{x}_{n}).$$
Now use $n(\bar{x}_{n-1}-\bar{x}_{n})=\bar{x}_{n-1}-x_n$ which follows from
$$n\bar{x}_n = \sum_{i=1}^n x_i = \sum_{i=1}^{n-1} x_i + x_n = (n-1)\bar{x}_{n-1} + x_n$$
and get for the difference:
$$Q_n- Q_{n-1} = 
x_n^2 - \bar{x}_{n-1}^2 + (\bar{x}_{n-1}-x_n)(\bar{x}_{n-1}+\bar{x}_{n})\\
=x_n^2 - \bar{x}_{n-1}^2 + 
\bar{x}_{n-1}^2 + \bar{x}_{n-1}\bar{x}_{n}-x_n\bar{x}_{n-1}-x_n\bar{x}_{n}\\
=x_n^2  + \bar{x}_{n-1}\bar{x}_{n}-x_n\bar{x}_{n-1}-x_n\bar{x}_{n}\\
=(x_n-\bar{x}_{n-1})(x_n-\bar{x}_n)
$$
