Sometimes I feel a bit uneasy about the mish-mash of the function design
in gretl. On the one hand they're supposed to be encapsulated, but then
there are various exceptions. But maybe this is a better approach than
having a cleaner but complex language definition...
What I don't fully understand is why the time-series situation is so
much different from other datasets. If you introduce such a change, why
not let functions do "un-subsampling" for other dataset structures as
well? I believe I could conceive useful scenarios for that, too.
-sven
Am 20.01.2011 16:15, schrieb Allin Cottrell:
As you probably know, we've emphasized the principle of
"encapsulation" for user-functions in gretl. One aspect of this is
that if the dataset is sub-sampled (non-contiguous observations
have been selected on some boolean criterion) on entry to a
function, you can't "un-subsample" inside the function (i.e. "smpl
full" will not give you the entire dataset as it exists at caller
level). This seems to me appropriate and I don't propose changing
it.
But we've also applied this principle to "regular" smpl setting,
where you just shift the end-points of the sample. To explain:
suppose we have a quarterly dataset that runs from 1980:1 to
2010:4. And suppose that on entry to a function the sample range
has been set by the caller to 1990:1 - 2005:4. Then inside the
function, although you can use smpl to adjust the end-points you
cannot shift them outside of the range set at the caller level.
E.g. in this case you couldn't get access to data before 1990 or
after 2005.
I'm now wondering if that is perhaps too restrictive. Bear in mind
that whatever sample is in force when a function is called will
always be restored when the function exits (again, something I do
not propose changing).
Any thoughts on this? Does it seem OK to let a function extend the
incoming sample range, provided it's then reset on exit? I think
this would make it easier to write certain kinds of potentially
useful functions.
Allin
_______________________________________________
Gretl-devel mailing list
Gretl-devel(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-devel