I have an unbounded process which generates normal distributed values (could be ints, but lets assume floating points for now). These values are put into bins of fixed size (e.g. bin 9 gets values in range [900.0, 1000.0) ). In the bins the following values are stored: number of observations, min, max, mean and variance. The mean and variance are calculated using Knuth's algorithm:
$M_k = M_{k-1} + (x_k – M_{k-1})/k$
$S_k = S_{k-1} + (x_k – M_{k-1})*(x_k – M_k)$
Where $x$ is the input value, $M$ is the mean and the variance is calculated from $S \over {k-1}$.
Now, I COULD calculate the global mean and variance while adding the values, but I was wondering how I could do this when I only have the means and variances of the bins (the values themeselves are not stored). The mean is trivial, but I'm not sure how to calculate the variance of the underlying process. Can someone please show me how?
Thanks in advance!