Am 14.03.2017 um 14:44 schrieb Allin Cottrell:
> Am 17.02.2017 um 13:03 schrieb Sven Schreiber:
>
>> I find it confusing in routine work that the lags() function wants to
>> have the lag number as the first arg, while the mlag() function wants to
>> have the input matrix first and afterwards the lag number.
>
> ping, stumbled over this again... but maybe it's just me.
I agree. If we had this to do over we'd try harder to do it
consistently. But isn't it now too late?
Yes, perhaps. OTOH, there is of course another difference between lags()
and mlag() which is already apparent from the names, namely that the
former gives you all lags up to p, whereas the latter gives you just one
lag (if you feed it a scalar lag arg).
So, one possible solution might be to introduce a new mlags() function
(note the plural-s) which would satisfy:
mlags(p, M) equivalent to mlag(M, seq(1,p))
mlags(p, M) analagous to lags(p, L)
Writing this down, another thing occurs to me: Couldn't lags() just be
overloaded, such that for a matrix argument M:
lags(p, M) equivalent to mlag(M, seq(1,p))
cheers,
sven