standard deviation
Jack L. Vevea
vevea at paideia.uchicago.edu
Mon Mar 27 05:31:45 AEST 1989
In article <9847 at ihlpl.ATT.COM> kat3 at ihlpl.UUCP (Craig,R.J.) writes:
>------------------------- cut here -------------------------
>The input data is given below:
>------------------------- cut here -------------------------
>10
>111111111.0
>111111112.0
>111111111.0
>111111112.0
>111111111.0
>111111112.0
>111111111.0
>111111112.0
>111111111.0
>111111112.0
>-------------------------- cut here ------------------------
>
>
>Notice that the onepass standard deviation is 1.78, while the twopass
>standard deviation is 0.5!!!!!! Incidentally, the true value is 0.5!!
>
Sure; and you could just as easily have picked another data
set that produced a correct result from the onepass program, and an
incorrect result from twopass. Which is why, as has been pointed out
before, neither algorithm should be used in a general standard
deviation program.
There was a posting recently to sci.math.stat, not crossposted
here, that gave a reference for better computational algorithms.
Saepe fidelis.
More information about the Comp.lang.c
mailing list