[Gretl-devel] omit bug
Allin Cottrell
cottrell at wfu.edu
Fri May 23 14:50:01 EDT 2008
On Fri, 23 May 2008, Sven Schreiber wrote:
> Am 22.05.2008 15:06, Allin Cottrell schrieb:
> > On Thu, 22 May 2008, Sven Schreiber wrote:
> >
> > > In a script of ours, we have an "omit" test statement after
> > > a standard (OLS) estimation, but in between there are some
> > > other calculations ("scalar" and "matrix", so effectively
> > > "genr" I guess).
>
> Ok, it seems to be related to calling a user-defined function
> after estimation and before the restriction test; here is a demo
> script:
>
> <script>
> open denmark
>
> function trivial(void)
> result = 1
> return scalar result
> end function
>
> ols LRM 0 LRY
> scalar check = trivial()
> omit LRY
> </script>
Thanks, I now see (and remember!) what's happening. As you know,
"omit" works on the "last model". Sometime after the 1.7.4
release I noticed that we had a problem with functions: if a
function estimated a model, this would remain the "last model" on
exit from the function, which is not what we want.
I then "fixed" this by simply NULLing out the last model on exit
from a function, with the results you found.
I've now implemented the right fix, namely, when we enter a
function we save a pointer to the current "last model" and on exit
from a function we restore that pointer.
Should be OK in CVS and Windows snapshot.
Allin.
More information about the Gretl-devel
mailing list