[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NA and NaN
From: |
Maynard Wright |
Subject: |
Re: NA and NaN |
Date: |
Wed, 12 Mar 2008 08:28:25 -0700 |
User-agent: |
KMail/1.9.1 |
On Wednesday 12 March 2008 08:01, Søren Hauberg wrote:
> ons, 12 03 2008 kl. 14:52 +0100, skrev Francesco Potorti`:
> > >> I see that Octave has NA, which is described in the manual as "a
> > >> special case of the representation of `NaN'". I do not understand
> > >> what this exactly means, because
> > >>
> > >> isnan(NA) --> 0
> > >
> > >Is it? In Octave 3.0.0 I see
> > >
> > >octave:1> isnan(NA)
> > >ans = 1
> >
> > Thank you. I use both Octave 2.1 and Octave 3.0, and I had not tried
> > both. I would appreciate someone to answer my previous questions
> > nonetheless, as there is so much code around written for octave 2.1.
>
> In what version do you see that isnan(NA) gives 'false'? I have never
> observed this behaviour, so I was quite surprised by your questions.
>
> > However, in light of Søren's observation, would it preferable to use NA
> > instad of NaN for missing values? What about octave-forge packages
> > "statistics" and "nan"? What about Matlab compatibility?
>
> Matlab doesn't have NA, so compatibility can be an issue, depending on
> the situation. The interpolation code (eg. 'interp2') uses NA when it
> performs extrapolation. In matlab NaN is used. Here there are no
> compatibility issues. Personally, I always use NA, when I'm missing
> data, and I never really understood how NaN is a good indicator of the
> same.
>
> Søren
>
In Octave 2.1.72, isnan(NA) returns ans = 0.
Maynard