help-octave
[Top][All Lists]
Advanced

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

Re: NA and NaN


From: Francesco Potorti`
Subject: Re: NA and NaN
Date: Wed, 12 Mar 2008 16:20:14 +0100

>> 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.

Octave 2.1 does this.  It is intended, as documented in the manual.

Octave 3 behaves differently.  This should mean that I can use NA for
missing values and use the nan* functions from the statistics and nan
packages, which is good.  Is this correct?

>> 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.

I would like to do the same in my code.  What about saved data?  If NA
is a NaN, Matlab should have no problems reading binary data.  However,
it should give an error on ascii data.  Is this the case?

>From a more general point of view, is it true that NA is only used by
Octave and R, while the rest of the world uses Nan?

-- 
Francesco Potortì (ricercatore)        Voice: +39 050 315 3058 (op.2111)
ISTI - Area della ricerca CNR          Fax:   +39 050 315 2040
via G. Moruzzi 1, I-56124 Pisa         Email: address@hidden
Web: http://fly.isti.cnr.it/           Key:   fly.isti.cnr.it/public.key


reply via email to

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