help-octave
[Top][All Lists]
Advanced

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

Re: Difference between NaN and NA?


From: Søren Hauberg
Subject: Re: Difference between NaN and NA?
Date: Thu, 08 Apr 2010 23:06:20 -0700

fre, 09 04 2010 kl. 07:54 +0200, skrev Jaroslav Hajek:
> > So, I guess my basic question is: is it even possible to create a class
> > that deals with NaN's (or NA's) entirely behind the users back?
> >
> 
> Perhaps not. In any case I don't care, because I generally don't want
> stuff operating behind my back.
> Besides, my idea was to make the class so that NA's and NaN's can be
> distinguished. Mathematically, NA + NaN should be a NA, not a NaN.

Ahh, I missed that point. Sorry 'bout the confusion.

> If you're OK with using NaN as both the missing and invalid value
> indicator, you're just better off using the statistics functions or
> the NaN package directly.

Ohh, I use them as two different things, but I do it all manually.

> > P.P.S. Should I just commit the 'nancov' function we wrote long ago to
> > the 'statistics' package?
> 
> I think we wrote something more complicated, that handled both NaN and
> NA at the same time in "the correct way", didn't we?

I think it just dealt with NaN's (and hence indirectly with NA's). If
you take the viewpoint that NA and NaN are two very different things,
then I don't think 'nancov' does the "correct" thing. IMHO the "correct"
thing would be to skip NA's, but let NaN's appear in the results if they
appear in the data sets.

> I suppose statistics should get just nancov, which simply skips all
> NaN's, to make it consistent with the rest.

I'll try to get the time to write the documentation for the function and
commit it.

Søren




reply via email to

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