 The Museum of HP Calculators

HP Forum Archive 11

 Re: Statistical Bug?Message #1 Posted by R Lion on 27 Mar 2003, 10:35 a.m. No, Dave: the 42s will give you the answer for two data. Try it. Raul

 Re: Statistical Bug?Message #2 Posted by hugh on 27 Mar 2003, 6:29 p.m.,in response to message #1 by R Lion you have a to be very careful when computing variances on calculators because they all use unstable methods, even hp. 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! 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.

 Re: Statistical Bug?Message #3 Posted by James M. Prange on 27 Mar 2003, 7:17 p.m.,in response to message #2 by hugh ...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.

 Re: Statistical Bug?Message #4 Posted by hugh on 28 Mar 2003, 6:32 a.m.,in response to message #3 by James M. Prange 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.

 Re: Statistical Bug?Message #5 Posted by James M. Prange on 2 Apr 2003, 3:01 a.m.,in response to message #4 by hugh 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(x2) for statistical functions. To implement your suggestion, the additional requirements would be to keep track of x1, adjust the data on every sum+ input, and adjust the output for things like sum(x), sum(x2), 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

 Re: Statistical Bug?Message #6 Posted by hugh on 7 Apr 2003, 5:30 p.m.,in response to message #5 by James M. Prange 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. Go back to the main exhibit hall