On Sat, Mar 7, 2009 at 4:20 PM, Søren Hauberg <so...@hauberg.org> wrote: > lør, 07 03 2009 kl. 09:42 -0500, skrev James K. Lowden: >> Alois Schlögl wrote: >> > Skipping NA/NaN is valid for the mean as well as for any other >> > statistical estimate. >> >> That is not always so. Suppose you intend to compute the mean of N values >> but due to an error in your database query, 90% of those values are >> missing. Are you prepared to say that the mean of the other 10% is >> representative? > > I would say that was the best estimate you could possibly get. > >> NaNs convey meaning, as Søren said. > > Actually, what I said was that there was a difference between something > being not-a-number, and something being missing. It makes perfect sense > to skip missing values when computing the mean value (in the statistical > sense). However, it does not make sense to ignore NaN's when they convey > the meaning that something went wrong somewhere else in your program. > Jaroslav explained this well. > > Søren >
Throughout this whole conversation, I totally forgot that Octave now supports NAs. In view of this fact, I think it would be completely sensible if the statistics functions automatically skipped NAs but not NaNs, unless it severely hurts performance. This is what R does, I think. In this way we can get sort of the best of both worlds. I'm not even sure it would mean an incompatibility with Matlab, since NaNs created by the NaN function or invalid ops will still work normally. I won't make any patches unless we have a more wide agreement, but my eventual vote is clear. cheers -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Octave-dev mailing list Octave-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/octave-dev