Am 06.10.2017 um 15:01 schrieb Allin Cottrell:
On Fri, 6 Oct 2017, Sven Schreiber wrote:
> 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)
Yes of course. But suppose you want the lags indicated by seq(3, hilag),
so you just want to skip the first two lags, and the user may choose
hilag. In general hilag=3 would be perfectly admissible, but would lead
to this problem.
A workaround for this particular example might be "lags(hilag, y) -
lags(2, y)"; although I could construct more complicated examples where
the problem would come back.
One solution might be to introduce a further optional arg to lags() to
clarify the intent, but since that fucntion already has an optional arg
(and as all args in hansl are positional), this would probably get