Am 24.11.2014 um 22:22 schrieb Allin Cottrell:
On Mon, 24 Nov 2014, Sven Schreiber wrote:
>
>> From a quick run-through of the functions that are listed under
> "filtering", it seems that the following could be affected:
>
> - bkfilt()
> - bwfilt()
> - hpfilt()
> - polyfit()
I'll take a look at those. Not sure offhand, but they (or some of
them) may resemble the exponential MA function, which necessarily
dies (goes all NA thereafter) the first time an NA is encountered.
Unless we implement re-initializing the filter after it crosses a
patch of missing values, but that would be complicated.
No, that's absolutely not what I meant and isn't worth it.
About the specific complications of these filters:
- while I don't know exactly how they're implemented in gretl, the
Baxter-King filter in practice should be a finite two-sided filter, no?
(In theory it's infinite, but I guess not implemented to use all data?)
That would mean that from an obs sufficiently far away from the missing,
it should work.
- similarly for H-P
- not sure about polyfit either, but the way it sounds a gap is probably
problematic
> And while I was testing these, calling the 'filter()' function with just
> the one required argument (according to the doc) gives me the error
> message that I need 4 arguments. So it seems the optional arguments
> aren't really optional?
Well, the args are optional, just not all at once. If you omit them
_all_ you get a null filter (i.e. you get back a copy of the
original series), therefore we set the minimum number of args to 2
(OK, the error message does not reflect that.) We could enable the
null filter case for completeness, I suppose.
I was just mechanically trying out the effect of NAs, not getting into
the meaning of the functions. Covering the "trivial" special case of not
filtering instead of failing sounds quite sensible, though.
thanks,
sven