On Wed, 8 Jan 2003, Scott S wrote:

> Does anyone know the formula for recursively calculating standard
> deviation?

There are several.  Which to prefer depends on how you're doing the
calculating (by hand, by hand calculator, by computer), what precision
you need in the result, and what information you are (or can be)
carrying along with each observation.  Might help if you described a
little of the background of your situation, including the number of
variables to which you want to apply the procedure (and if more than
one, whether you want to update covariances or correlations as well).

I would recommend updating the variance rather than the standard
deviation, since otherwise there are potential rounding-error problems
arising from repeatedly squaring and then taking the square root;
whether these problems are worrisome depends on the precision with which
you choose to calculate.

OTOH, my personal preference is to carry along the sum and sum of
squares of the variable (possibly after subtracting a baseline value);
the updating is much easier, and one is less likely to error in the
application of a more involved formula than one of the standard ones.

In any case, you will need to carry along at a minimum information
equivalent to the number of cases so far, the current sum, and the
current sum of squares;  e.g., the number of cases, the current mean,
and the current variance (or, if you insist, standard deviation).

If you're doing this in a computer, it's hard to imagine that your
storage capacity would not permit carrying sum & sum of squares as well
as current mean and s.d.

 -----------------------------------------------------------------------
 Donald F. Burrill                                            [EMAIL PROTECTED]
 56 Sebbins Pond Drive, Bedford, NH 03110                 (603) 626-0816
 [was:  184 Nashua Road, Bedford, NH 03110               (603) 471-7128]

.
.
=================================================================
Instructions for joining and leaving this list, remarks about the
problem of INAPPROPRIATE MESSAGES, and archives are available at:
.                  http://jse.stat.ncsu.edu/                    .
=================================================================

Reply via email to