On Wed, 1 Feb 2012, Sven Schreiber wrote:
On 01/31/2012 09:13 PM, Allin Cottrell wrote:
> On Tue, 31 Jan 2012, Henrique Andrade wrote:
>
>> Is there any way to retrieve the roots of an ARIMA model? Is there an
>> accessor that allows this kind of operation?
>
> They are attached to the model in question under the name
> "roots". While there is no "$roots" accessor as such, it's
now
> possible to retrieve them (in CVS and snapshots) via the
> special form $["roots"]. This form will work for any named
> data attached to the last model in the form of a scalar,
> series or matrix. Example:
>
> open data9-7
> arma 1 2 ; QNC
> matrix r = $["roots"]
> r
>
> This form treats the last model as if it were a "bundle", from
> which any suitable named data can be extracted.
Ho ho -- hold it :-)
Seriously, isn't this new syntax being introduced a little hastily? So
far everything that could be accessed got its $-accessor. This $[] thing
seems to be all new. I'm not saying it's bad, but it seems to exist in
parallel to the old-style accessor. After all, all existing accessors
could now be re-defined, for example $coeff -> $["coeff"]. Maybe that's
the way to go (old-style accessors could be kept as syntactic sugar for
backward-compatibility).
Though I mentioned it here, the $["name"] thing isn't really
ready for roll-out. To see what's available in that mode you
really have to grep the gretl sources for
gretl_model_set_data
gretl_model_set_double
gretl_model_set_int
and so on. These "set" functions are ways of attaching named
data for internal use, but the bundle-key syntax makes it easy
for users to grab a copy -- if you know what to look for.
Allin