Am 24.01.2017 um 13:59 schrieb Sven Schreiber:
 Am 24.01.2017 um 12:53 schrieb Artur T.:
> The error message when calling tscvrol() is:
>
> <output>
>  --dynamic: inapplicable option
 
 Actually I think gretl is probably right: In your second example gretl
 has no way of knowing that the xlist contains the lags of your y
 variable. Because you have transformed your x input into a matrix, and
 then arbitrarily back to a series. How is the function tscvrol supposed
 to know how you constructed y previously?
 
 cheers,
 sven 
Indeed, Sven, you're right. I totally overlooked this aspect! Replacing
<hansl> OLD
	ols y xlist
</hansl>
by
<hansl> OLD
	ols y 0 y(-1 to -2)
</hansl>
in tscvrol() solves the problem. Thanks for your help, Sven!
I am just thinking how to solve this in the package. I could either ask
the user to provide a separate vector signaling gretl which AR-lags to
include into the regression or (maybe a more flexible approach but not
sure whether this works!) to provide a string of the command as for
instance <string C = "ols y 0 y(-1 to -2)"> but I haven't tried it,
yet.
Thanks for this suggestion, Allin. Actually the version I've used before
works but using strings may be more accurate or more tidy to program.
 Commands (as opposed to functions) are not generally equipped to
handle arbitrary expressions such as the above. Try using string
substitution and see if that works:
 string ft1 = sprintf("%d", $t2+1)
 string ft2 = sprintf("%d", $t2+b.nhor)
 fcast @ft1 @ft2 --dynamic
 Allin 
Artur