loop/if/loop bug fixed?
by Allin Cottrell
Hello all,
I discovered today (and fixed, I hope) a rather nasty bug that I
suppose has been around for a long time, if not forever. It arose
when you have an loop which contains a series of inner, embedded
loops, each executed conditionally. Here is a trivial example:
<script>
nulldata 10
loop i=1..4 -q
if i%2
loop j=1..2 -q
printf "inner loop 1: j = %d\n", j
endloop
else
loop j=2..3 -q
printf "inner loop 2: j = %d\n", j
endloop
endif
endloop
</script>
Up till today, "inner loop 1" would get executed each time round
the outer loop (and "inner loop 2" would never get executed).
The reason for this is that inner "child" loops were identified by
their calling order (child 0, child 1, etc.) within the outer
loop, on each iteration of the outer loop. Given the
conditionality in the script above, only one inner loop gets
called on each iteration of the outer loop, so although both inner
loops were correctly compiled and attached, only the first ("child
0") got called.
The fix for this is to identify the "children" of an outer loop
not simply by calling order, but by the line number in the outer
loop at which they are called. That is, when a "loop" command is
found within a loop, we now do this:
* What line number are we on, in the outer loop? Call this "j".
* Look for a child loop that is connected to line j.
* Did we find one? If yes, execute it; if not, it's a bug.
My apologies for this stupid logic error. I think we should be OK
now, but please report any fallout you detect.
Allin.
16 years, 6 months
bug which is new in 1.7.4
by Sven Schreiber
Hi,
I have a relatively complicated bootstrap script which works with 1.7.3
(I just re-confirmed this) but stops working with 1.7.4. Gretl 1.7.4
just hangs (becomes unresponsive forever, like being in an infinite
loop) and has to be killed by the OS. All this is on Windows XP, I
cannot test on Linux before the weekend (if that's needed).
I haven't had time to pin down the bug yet, but I suspect it may have to
do with the 'resample' changes that were introduced in 1.7.4. I'm using
the resample command with matrices (well, the pre-1.7.4 usage).
I haven't tested a recent snapshot yet, should I? I may be able to test
some more this afternoon (Central European time).
cheers,
sven
16 years, 6 months
Strange bug in count data models
by Riccardo (Jack) Lucchetti
Dear all,
it seems we have a bizarre bug in our Poisson estimation code: if the
dependent variable is called "d_avril" we get bogus estimates. Example:
Model 1: Poisson estimates using the 100 observations 1-100
Dependent variable: d_avril
VARIABLE COEFFICIENT STDERROR T STAT P-VALUE
const 0.000000 0.000000 0.000 0.00000 ***
x1 1.000000 1.000000 1.000 1.00000
x2 2.000000 2.000000 2.000 2.00000
We are investigating on this, but we are certain that it will be fixed
within 24 hours. Still, if you could confirm this bug, it would be very
helpful.
Thanks in advance.
Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche
r.lucchetti(a)univpm.it
http://www.econ.univpm.it/lucchetti
16 years, 6 months
Gretl's handling temporary variables
by Amir Reza Khosroshahi
Hi,
It seems that in gretl, you cannot have temporary variable— that are
generated and then discarded in a command. For example the following
commands are invalid in gretl:
> print $rsq
> smpl $t1+1 $t2
> print 2+2
But commands like these are perfectly logical in other programming language,
and being able to handle variables in this way makes life much easier!
Is gretl going to support this kind of handling variables?
Best,
Amir
--
<signature>
Amir Reza Khosroshai
</signature>
16 years, 6 months