In respones to: Consider a standard Z-statistic used in hypothesis testing. One of the variables needed to compute the Z-statistic is the number of observations. The problem is that with each additional observation one has to recompute the Z-statistic from scratch. It seems like there is no recursive formulation, e.g. a representation such as Z(n) = Z(n-1) + new piece of information. Is there perhaps an approximate recursive formulation? Any other thoughts? Thanks.
An example hypothesis test is:
We reject this hypothesis if is either greater than or lower than a critical value. Assuming the critical values do not change all you have to update is .
The test statistic is:
Assuming you know , when you get a new variable you can update using , , and , then recalculate .
Now if you do not know , and your sample size is large enough to use the Normal distribution, you have to update your sample variance, . If your sample size is not large enough and you are using the t-distribution then your critical values will change when changes.
To do update without recalculating, you should keep running totals of and , so you can update using the computation formula for the sample variance.