weird statistics bug in wp34s



#7

Statistics subsystem does not like certain numbers in Y. For example,

350.33050223 ENTER 
3.265 [+/-] [EEX] 10 [+/-]
[+]
Cl[SIGMA]
1 [SIGMA]+
2 [SIGMA]+
3 [SIGMA]+
4 [SIGMA]+
5 [SIGMA]+
[g] [5]
Attempt to calculate s (standard deviation) gives domain error.
This time, the effect is reproducible on emulator.

This is highly number-specific. Many numbers are breaking it, but many numbers pass through. Without that -3.265E-10 it does not give error.


#8

FWIW, it does return 1.581 and not give any error on the real thing (2.2 2738).

d:-)

#9

For each accumulation you made, the value in Y was unchanged so sy should be zero.

However, the problem is due to a rounding error during the calculation of sy. Sigma y2 - n * (sigma y)2 ends up being slightly negative.

I'd have preferred to use the robust formulas for this but was hamstrung by the need for backwards compatibility.

I've committed a fix which will be in the next firmware revision.


- Pauli


Edited: 19 June 2013, 2:08 a.m.


#10

And what are the robust formulas?
And why they are not backward compatible?


#11

Formulas for variance. Specifically, the on-line algorithm.

Recovering the various summation terms we had to support isn't trivial -- people expect the usual sums: x, x2, y, y2, xy and all the logarithmic variations. Far easier to just use the traditional method, albeit in double precision for some of the summations.


- Pauli


#12

Thanks for the link Paul. I have been looking for robust algorithms to calculate the mean and standard deviation.


Possibly Related Threads...
Thread Author Replies Views Last Post
  wp34s binomial bug Andrew Nikitin 4 402 09-22-2013, 05:20 PM
Last Post: Paul Dale
  hp50g screen weird line Sok-khieng Chum Hun 2 364 09-10-2013, 08:11 AM
Last Post: Sok-khieng Chum Hun
  Expon bug in wp34s Andrew Nikitin 7 609 07-14-2013, 03:23 AM
Last Post: Marcus von Cube, Germany
  another wp34s bug Andrew Nikitin 8 655 06-26-2013, 01:01 AM
Last Post: Paul Dale
  HP 10s+ Easter Egg (Statistics) Eddie W. Shore 1 246 04-11-2013, 04:25 PM
Last Post: Andrew Feist
  [WP34S] A funny bug in Pi (prod) Eduardo Duenez 3 444 01-28-2013, 03:41 AM
Last Post: Walter B
  [WP34s] Bug or feature? Dieter 25 1,427 01-03-2013, 06:20 PM
Last Post: Paul Dale
  Weird behavior from lithium AAs Dave Britten 4 365 11-14-2012, 06:22 PM
Last Post: Lars Bergström
  [WP34S] WP34S firmware on the AT91SAM7L-STK dev kit? jerome ibanes 1 318 10-04-2012, 04:59 PM
Last Post: Paul Dale
  Bug in WP34S? Namir 5 477 08-05-2012, 06:32 PM
Last Post: Namir

Forum Jump: