On Fri, 7 Dec 2012, Sven Schreiber wrote:
when lags() is applied to a list (of series), then the result is
grouped
by variables, i.e. lags(2,mylist) gives
x_1 x_2 y_1 y_2
if x and y are the list members.
In the VAR/VECM context we typically have the variables ordered by lags
instead, i.e. we need
x_1 y_1 x_2 y_2.
(For example, implicitly this standard ordering is also used by the nice
accessor $vecGamma which I just recently discovered.)
I wrote a little loop that roughly does what I need by repeatedly taking
lags; it's good enough for me I guess, although names turn out like
x_1_1 instead of x_2, but I can live with that (thanks to the new
extended character limit for names!). But still I was wondering whether
this would be an argument to extend the lags() function to do that more
cleanly, maybe with an optional parameter or something.
In CVS (not yet snapshots) you now have that. There's an
optional third parameter called "bylag": if you give a
non-zero argument the output list will be ordered as you
describe (lag 1 of all series, then lag 2 of all series,
usw).
Allin