On Wed, 30 Jun 2010, Joel Bycraft wrote:
Is there documentation on the defintion of the 'list'
Sorry this has taken a while.
For general information on how gretl "lists" work see the "Lists"
sub-section of the libgretl API docs (under the "Utilities"
heading). Note that I've done quite a bit of work on these docs
lately, though they're still very much incomplete and are unlikely
to be completed any time soon. http://gretl.sourceforge.net/API/
I see the example for the OLS, however I am looking to use ARMA.
It list: dependent variable, AR and MA orders, and any exogenous
regressors. However, I don't see the specific integer values to
You should refer to the help entry for the "arima" command in
gretl to understand this. The specification of the arma list is
given in detail there. (In general, where the API docs are obscure
on a given function, and that function directly implements a gretl
command, that's what you'll have to do.)
Although there are other ways of doing this, for the present
you're probably best constructing the list argument for arma by
composing a string as per the help on arima, then calling
gretl_list_from_string to convert it to an actual "list".
const char *arma_spec = "1 2 ; 5";
int err = 0;
int *list = gretl_list_from_string(arma_spec, &err);
/* if err == 0, use the list ... */
free(list); /* once you're finished with it */
In this example the AR order is 1, the MA order is 2, and
the dependent variable is at position 5 in the "Z" data array.
To add seasonal terms, again look at the "arima" help.
also the data array for arma() is const double, why is that
different from say lsq()? How would I go about using this
The assumption in libgretl is that a two-dimensional data array Z
(of type double **) lives somewhere in the calling program. With
some libgretl functions it is sufficient to pass Z as an argument
result = some_gretl_func(..., Z, ...);
but with others you must pass its address:
result = some_other_func(..., &Z, ...);
The functions that require the address of Z are ones that may
resize the Z array under some conditions: lsq is one such (it may
add auxiliary series to the data array temporarily). The arma
function, on the other hand, never resizes Z so it doesn't require
Note that whenever you see "***pZ" as a libgretl function
parameter, the corresponding argument should be "&Z". (Well,of
course you can call "Z" anything you like in your own program.)
Just out of interest, do you have a specific reason to do ARMA
modeling "the hard way", using libgretl yourself, rather than