Am 07.04.2025 um 20:21 schrieb Cottrell, Allin:
Here's a further response to Sven after doing some more
investigation.
It's unlikely to be of interest to anyone who's not in the business of
writing packaged functions that key off models represented in windows
in the gretl GUI.
The key question is this: under what conditions does gretl, inside a
function, "know about" series that exist at the level from which the
function was called? The answer:
1) Obviously, gretl knows about series that were explicitly passed as arguments.
2) In addition, gretl knows about series that are referenced in a
"list" passed as an argument. Such series are temporarily
"localized"
to the function, then returned to their original level when the
function returns.
3) As an extension of point 2, we also temporarily "localize" series
that are referenced in a list contained in a bundle passed as an
argument to the function in question.
And that's all.
Hm, what about $xlist, $uhat and all that in a packaged function from a
model window, not accessed through $model but directly in their own
right? Would that count as (3b)?
What Sven was trying to do would work if and only if
we also "localize" series referenced in a list contained in a bundle
that's _not_ passed as an argument but is made available within the
function via the $model accessor -- something we have not attempted to
date.
OK, but two questions remaining:
1) See my other email some minutes ago: the listmaker example with list
"L = m.xlist - m.instlist" seems to do just that, no?
2) There's still the weirdness of my OP that it did work when I called
my other function rhslags() which shouldn't have changed anything AFAICS.
-s