On Sat, Mar 7, 2009 at 5:12 PM, Søren Hauberg <so...@hauberg.org> wrote: > lør, 07 03 2009 kl. 17:00 +0100, skrev Jaroslav Hajek: >> 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. > > I've always felt that NA wasn't being used as much as it should. I use > it quite a bit in my own functions. The only place I know of in Octave > that actively uses NA are the interpolation functions. These use NA as > extrapolation values rather than NaN (like Matlab). I haven't seen any > compatibility issues since we made this change. > > Anyway, I would definitely support skipping NA's in the statistics > functions. But perhaps the performance drop would be too big? >
For the simple stuff like mean, std etc, I'd hope not. For instance, the current optimized sum and sumsq seem to be essentially equally fast (if Octave is compiled with enough optimization), which suggests that the real bottleneck for "sum" are cache misses. So I think a well optimized NA-skipping reduction would help. Thinking about functions using more advanced matrix operations, however, I'm less sure. "cov" is a good instance. How does one calculate a NA-skipping cov? Does it mean not being able to use standard matrix functions? Can it be done by just replacing NAs with zeros (I'm not sure now)? If we can't use BLAS, that would mean a significant penalty. regards -- 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