How do I compute/estimate the variance of sequential data? Say I have a (infinite) sequences like 1, 3, 2, 2, 1, 3 ...  
I want to estimate their mean and variance of the sequence at time $t$.  
But I won't have enough storage to keep all the data seen previously.  
I know I can compute the mean by only keeping the sum of the sequence by far, then divide through by time $t$.
But how can I compute/estimate the variance (using a constant amount of storage)? Is there any trick/model for this?  
 A: The proper answer to your question is named online sample variance, and in general online statistics. It's named online because you update the current value of the sample statistic and don't look back at that number.
In order to find an online algorithm to handle that what you need is to break the definition of sample variance into two kind of terms: first kind would use previous information and the second kind the new value.
For simplicity I let's look at sample mean: $m_n = \frac{1}{n} \sum_{i=1}^{n} x_i$, where $n$ is the number of elements and $x_i$ is the element from the stream at $i$-th position.
Let's do some tricks:
$$m_n = \frac{1}{n}\sum_{i=1}^{n} x_i = \frac{n-1}{n(n-1)}(\sum_{i=1}^{n-1} x_i + x_n) = \frac{n-1}{n}(\frac{1}{n-1}\sum_{i=1}^{n-1}x_i) + \frac{1}{n}x_n$$
Now you recognize in the last expression in parenthesis the term $m_{n-1}$, so we have the following recursive relation:
$$m_n = \frac{n-1}{n}m_{n-1} + \frac{1}{n}x_n$$
which states that we have to know the number of elements and the mean from a current step to compute the next mean by using also the next element.
Similar recursive equations can be developed for minimum, maximum, standard deviation, variance, skewness and kurtosis. 
For a full explanation look at the beautiful article by John D. Cook. I implemented myself such an online statistic tool in Java, which you can find here
A: It seems after some looking around, that the algorithms given in this technical report by Chan, Golub, and LeVeque from 1983 are still the state of the art.
A: My intuition, might not be correct:
Lets say you divide sequence in 2 groups having same number of elements, calculate there mean (mean1 and mean2) and variances (variance1, variance 2) , For calculating variance 2 you can use combined mean of both the sequences i.e. (mean1 + mean2)/2, Now based on this mean (mean3) you can correct variance of first sequence lets call it variance3, Now combined variance will be (variance3 + variance2)/2
