On Fri, 30 Jan 2015, Artur Bala wrote:
Dear Allin and Jack,
As Jack suggested (some months ago) I use "catch" into a loop command in
order to skip cases where a biprobit estimation could not be provided.
My script looks like :
*loop 200 --progressive*
*do some random sorting*
*catch biprobit y1 y2 const x1 ; const x2*
*err = $error*
*if !err*
* do some stuff*
*else*
* do nothing in particular*
*endif*
*endloop*
This script used to work perfectly in an earlier version of gretl
(by mid-2014). The problem is that it doesn't work anymore and its
execution is interrupted if the estimation procedure fails
Instead, everything is ok when I use a "loop for" command instead
of the progressive loop.
OK, I can replicate "catch" not working as advertised, in a
"progressive" loop. Here's a minimal but complete example:
<hansl>
nulldata 40
set seed 1234
series y = normal()
series x
scalar i = 1
loop 5 --progressive --quiet
if i == 3
x = 0
else
x = normal()
endif
catch ols y x
err = $error
if !err
printf "i=%d: nothing to worry about\n", i
else
printf "i=%d: caught an error\n", i
endif
i++
endloop
</hansl>
However, I doubt that this ever "worked perfectly". Maybe you got
lucky, but as they stand progressive loops are not really configured
to work right if an estimation command fails on one or more
iterations. I'll take a closer look and report back.
Allin