We could do this in StatsBase. In general, our approach has been to encourage development of tools for working with missing data in a more generic way than using NaN, which is what DataArrays are meant for. But NaN are a totally reasonable tool when you're willing to commit to floating point arithmetic, so we might want to add some flags to the functions in StatsBase to do this.
-- John On Feb 5, 2014, at 8:11 PM, Roger Herikstad <[email protected]> wrote: > Hi, > Are there equivalent functions to Matlab's nanmean and nanstd, i.e. > functions for computing mean and standard deviation while ignoring NaN's? > It's simple to put something together, of course, e.g. > > function nanmean(x) > mean(~isnan(x)) > end > > but it would nice to have as part of Base, or perhaps StatsBase? > > ~ Roger
