Thank you very much Alan, this was just what I needed. Luigi -- Luigi Bianchi http://www.luigbianchi.com [EMAIL PROTECTED] Programming, C++, OWL, VCL, SDK, Dfm2API "Alan Miller" <[EMAIL PROTECTED]> ha scritto nel messaggio news:ml617.4542$[EMAIL PROTECTED]... > Luigi Bianchi wrote in message <9i2doj$r61$[EMAIL PROTECTED]>... > >Hi to all, it's the first time that I post to this NG, so I hope it is the > >right place. > >I have the following problem: I read data from an A/D board and I have to > >provide an estimation of the SD of the population on-line, that is each > time > >I read a sample I have to update the mean and SD. While it is really easy > to > >update the mean, I don't remember how to do the same thing with the SD. I > >remember that there was a formula, but I don't remeber it. Anyone could > help > >me? > > > >Thanks in advance, > > Luigi > > > >-- > >Luigi Bianchi > >http://www.luigbianchi.com > >[EMAIL PROTECTED] > >Programming, C++, OWL, VCL, SDK, Dfm2API > > > > > You update the mean and the sum of squares of deviations from the mean: > For each new case (new value x) > n = n + 1 > dev = x - mean > mean = mean + dev/n > ssq = ssq + dev*(x - mean) > > Then the usual st.devn. estimate is: > sd = sqrt(ssq/(n-1)) > If you want an approximately unbiased estimate of the std. devn., use > sd = sqrt(ssq/(n-1.5)) > > -- > Alan Miller (Honorary Research Fellow, CSIRO Mathematical > & Information Sciences) > http://www.ozemail.com.au/~milleraj > http://users.bigpond.net.au/amiller/ > > > ================================================================= Instructions for joining and leaving this list and remarks about the problem of INAPPROPRIATE MESSAGES are available at http://jse.stat.ncsu.edu/ =================================================================
