On Tue, 14 Mar 2017, Sven Schreiber wrote:
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)
No, please, let's not overpopulate the namespace.
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))
Now, THIS I like!
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------