On Tue, 24 Jul 2018, Sven Schreiber wrote:
Am 24.07.2018 um 16:18 schrieb Allin Cottrell:
> Following discussions between Jack and myself, here's a sort of
> "RFC" for changing the internal definition of "NA" in gretl,
which we
> believe can be done with full backward compatibility.
>
> Little PDF attached.
Thanks for the excellent exposition of the problem. One thing I don't
understand from the document, however, is what would happen in the end with
the NA * 0 = 0 feature when NA becomes nan. AFAICS your point is that it
would be a nice feature but we don't have it currently, anyway, so let's
forget about it forever? (Not saying I'd be against this, just trying to
understand for now.)
Yes, I think "nice feature but we don't have it currently" is about
right. Consider the following (abdata has lots of missing values,
including the very first observation):
<hansl>
open abdata.gdt
WAGE[1] = WAGE[1] * 0
smpl 1:1 1:9
print WAGE --byobs
series bad = log(-WAGE)
bad[1] = bad[1] * 0
print bad --byobs
</hansl>
The first "print" shows that the leading NA for WAGE has indeed been
changed to 0 (defensibly). But the second "print" reveals that bad[1]
also gets changed to 0, which is not so defensible. That happens
because the nans in "bad" are automatically mapped to NA as things
stand.
Under the proposed scheme NAs (= nans) would not turn into zeros on
multiplication by zero -- but the misszero() function would still be
available to do that job.
Allin