you have a to be very careful when computing variances on calculators because they all use unstable methods, even hp.

<rant>

itsn't it about time we had a calculator that actually worked and did the right thing. the problem comes from use of a formula that magnifies error. for example, do this:

clear sigma.

1e6 sigma+

1e6-1 sigma+

1e6+1 sigma+

and what do you get. s = 0 what rubbish!

</rant>

the correct way is to make use of a two-pass formula (as described in numerical recipes in C page 613). however, that method involves storing all the data points so as to make a second pass.

a cheap "calculator" fix avoiding extra storage would be to simply subtract the first number entered from all the numbers entered. this would approximately renormalize the data by the mean.

*...for example, do this: clear sigma. 1e6 sigma+ 1e6-1 sigma+
1e6+1 sigma+ and what do you get. s = 0 what rubbish!*

Not *all* HP calculators! The RPL models return 1 for that. They do

indeed store all of the data points.

*a cheap "calculator" fix avoiding extra storage would be to
simply subtract the first number entered from all the numbers entered.
this would approximately renormalize the data by the mean*

Yes, that should work. For the "cheap" calculators that we actually

have, the user can use the method that I mentioned in

this post.

excellent!

i'd simply assumed the RPL ones had the same algorithms copied over. this nice to know, at last.

i like your "encoded" form, its better than my; subtract the number you firsr thought of hack. its a pity that units than dont store the data don't do something like this.

Thank you.

My method has the advantage that when using it, one typically doesn't

need to enter so many digits. This can be especially important when

entering hundreds of data points.

On the other hand, your idea has the advantage that the user wouldn't

even need to be aware that the data was being adjusted. If I recall

correctly, many calculators keep track of only n, sum(x), and

sum(x^{2}) for statistical functions. To implement your

suggestion, the additional requirements would be to keep track of

x_{1}, adjust the data on every sum+ input, and adjust the

output for things like sum(x), sum(x^{2}), mean, and total.

Seems to me that it should be feasible on many calculators, and the

extra calculations would be scarcely noticeable to the user.

Have you applied for a patent yet?

Regards,

James

oops, sorry james, was this in response to my stats correction idea? i didnt see this post earlier.

if so then, yes and no :-)

yes, thats what i meant and no, there's no patent. :)

basically, was thinking along the lines of what people do by hand. a friend works in a lab calibrating instruments. as you can imagine the results are heavily clustered around a central figure.

what they do (manually) is subtract the figure that they expect from each number and enter those numbers in excel(for example). in fact if you dont excel gets it wrong. yes wrong! just like a cheap calculator that doesnt store the numbers. you'd think that after all these years of hypertext email and featureitis it would work in the worlds leading spreadsheet. heck, they should be doing the proper two-pass forumla properly... ooops ranting again!

this and many more reasons is why we still need quality algorithms in calculators.