0
$\begingroup$

I only get one value at a time in the system that I am developing. However whenever I get my first value I should already be able to calculate a variance. Every time I get a new value I should recalculate the variance. One important note is that I can't save any previous values, I should thus be able to calculate variances "on the fly".

Something like this is what I would need but for variances.

Thank you

$\endgroup$
9
  • $\begingroup$ Please see stats.stackexchange.com/search?q=online+variance. $\endgroup$
    – whuber
    Commented Apr 4, 2017 at 19:44
  • $\begingroup$ You could update the estimate using a recursive formula. However I don't follow your premise that you can estimate a variance based on only the first value. $\endgroup$ Commented Apr 4, 2017 at 19:45
  • 1
    $\begingroup$ @Michael Use the Normal MLE for variance: it works even with one value (and is zero, but so what?). $\endgroup$
    – whuber
    Commented Apr 4, 2017 at 19:46
  • $\begingroup$ @whuber I guess that is fine for the algorithm as long as you don't take the first estimate seriously. $\endgroup$ Commented Apr 4, 2017 at 19:54
  • 1
    $\begingroup$ This brings us back to @Michael Chernick's comment: your situation makes little sense in that case. Exactly what do you mean by "n is always equal to 1"? After you have obtained a second value, you have two values. When the third comes in, you have three--and so on. The whole point of the duplicate is that to update the variance, as you request, you don't need to save the previous $n-1$ values. But you do need to save a little bit of information! $\endgroup$
    – whuber
    Commented Apr 4, 2017 at 20:37

0

Browse other questions tagged or ask your own question.