Recursive Z-statistic

In respones to: Consider a standard Z-statistic used in hypothesis testingMathworldPlanetmath. 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:

H0: μ=μ0

H1: μμ0

We reject this hypothesis if x¯ is either greater than or lower than a critical value. Assuming the critical values do not change all you have to update is Z0.

The test statistic is:


Assuming you know σ, when you get a new variable Xn+1 you can update x¯ using n, X¯, and Xn+1, then recalculate Z0.

Now if you do not know σ, and your sample size is large enough to use the Normal distributionMathworldPlanetmath, you have to update your sample varianceMathworldPlanetmath, S2. If your sample size is not large enough and you are using the t-distribution then your critical values will change when n changes.

To do update S without recalculating, you should keep running totals of iXi and iXi2, so you can update S using the computation formula for the sample variance.

Title Recursive Z-statistic
Canonical name RecursiveZstatistic
Date of creation 2013-03-22 19:11:30
Last modified on 2013-03-22 19:11:30
Owner statsCab (25915)
Last modified by statsCab (25915)
Numerical id 4
Author statsCab (25915)
Entry type Definition
Classification msc 62-00