[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: max() and min() of nan/inf

From: John W. Eaton
Subject: Re: max() and min() of nan/inf
Date: Thu, 23 Sep 1999 11:55:34 -0500 (CDT)

On 23-Sep-1999, Mike Miller <address@hidden> wrote:

| A few years ago, when MATLAB was developing their stats toolbox, they
| added the functions nansum, nanmean, nanmedian, nanvar, nanstd, nanmax,
| nanmin, nancov and nancorr.  These functions were identical to sum, mean,
| median, var, std, max, min, cov and corrcoef except that they ignored NaNs
| in the computations (they do not ignore Inf and -Inf).

| Does octave have any of those functions?

Not that I know of.

Why not just add an optional parameter to min, max, etc. that says to
ignore NaNs?

  Y = min (X, "ignore_nan");

Some questions:

  * If a vector is all NaNs, should the result be [] or NaN?

  * If a matrix has a column that is all NaNs, what should the result
    be for that column?  I'd say NaN, since an individual matrix
    element can't be [].  Then for consistency, the answer for the
    previous question should probably also be NaN.


Octave is freely available under the terms of the GNU GPL.  To ensure
that development continues, see
Instructions for unsubscribing:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]