On Tue, 30 Apr 2013, Allin Cottrell wrote:

> On Mon, 29 Apr 2013, Sven Schreiber wrote:
>
>> Ok, so I remembered some things correctly (see below), but indeed had
>> forgotten the most important part: It's already there! Just push the
>> "lags" button in the VAR specification dialog and enter your individual
>> lag structure (comma-separated I think).
>> 
>> See http://lists.wfu.edu/pipermail/gretl-devel/2009-February/001682.html
>> for the original discussion, already four years ago... time passes
>> quickly...
>> 
>> It remains to be said that the CLI version is still undocumented at
>> least in the online help.
>
> Thanks for chasing this down, Sven.
>
> The CLI counterpart to the special use of the "Lags" button in the GUI is 
> appending an option string of the form
>
> --lags=<lags>
>
> e.g.
>
> --lags=1,2,4 # or --lags="1,2,4"
>
> The reason this has never been documented is that it was a quick-and-dirty 
> hack. It's not nice to have a lag order as the first argument to the "var" 
> command plus an option to specify lags at the end. The right way to do this 
> would be to allow use of the name of a matrix in place of the scalar "order" 
> argument, as in
>
> matrix p = {1,2,4}
> var p Ylist
>
> I guess, though, that implementing that functionality has not seemed like a 
> high priority to date.

OK, it's now implemented in CVS, and the undocumented 
"--lags=" option has been removed. Formulations of the 
following sort will now work:

var 4 Ylist         # still OK, of course
matrix p = {1,2,4}
var p Ylist         # give a named vector
var {1,2,4} Ylist   # give an inline vector

I'll document this shortly.

In regard to the libgretl API, a second parameter to gretl_VAR 
has been inserted, namely a list of lags. The argument can be 
given as NULL for regular VAR behavior. Examples of use:

<C>
/* regular VAR specification */
v = gretl_VAR(4, NULL, dataset, OPT_NONE, prn, &err);

/* gappy specification */
int laglist[4] = {3, 1, 2, 4};
v = gretl_VAR(4, laglist, dataset, OPT_NONE, prn, &err);
</C>

"laglist" is in standard gretl list form, with the first 
element indicating the number of elements that follow. So the 
second VAR will include the three lags 1, 2 and 4.

Allin Cottrell


Reply via email to