On Fri, 6 Oct 2017, Sven Schreiber wrote:
Hi,
see this:
<hansl>
thislag = 3
series hey = normal()
list L = lags(thislag, hey)
eval nelem(L)
list LL = lags({thislag}, hey)
eval nelem(LL)
matrix lagseq = seq(thislag, thislag)
list LLL = lags(lagseq, hey)
eval nelem(LLL)
</hansl>
Every time I get a 3-element list, wheras according to the lags() spec only
the lag numbers specified in the vector argument should be calculated.
I understand this comes from gretl allowing a 1x1 matrix for a scalar. But
this is a problem when the vector argument inside a program might become a
1-element thing depending on other choices.
Not sure what a good solution would be, though.
We could easily modify the underlying function such that if a 1 x 1
matrix is passed as the first argument you just get the single
specified lag (rather than, as at present, treating the single value
as the maximum lag). Probably most of the time this would match the
user's intent.
On the other hand, this usage seems a bit odd. If you want just a
single lag, the idiomatic way to do it would be something like
series target_3 = target(-3)
wouldn't it?
Allin