On Mon, 6 Oct 2014, henrique.andrade(a)bb.com.br wrote:
I think there's something wrong with the "catch"
function. The problem
occurs inside a function and inside a loop. Please take a look at the
attached script and functions (AutoARIMA and Backtest).
When I use a "catch" in the line 96 of the "Catch & Function
potential
problem.inp", Gretl stops responding and crashes. Also, when I don't use it
in the command the second loop inside "Catch & Function potential
problem.inp" (the loop starts in line 83) generates an error.
There is an error in estimating one of the arima models: "Failed to
compute numerical Hessian." If you use "catch" on this but do not check
the $error value, then the subsequent fcast command will reference a
broken model. This will no longer (in CVS and snapshots) cause a crash,
but it will cause an uncaught error that will stop the script. The idea
with "catch" is like this:
<hansl>
catch arima ...
if $error
# skip to the next iteration or something, but
# don't try to do anything with the "last model"
else
fcast ...
endif
Furthermore, the "flush" command is not working in this
context.
Ah, the help text for "flush" was not explicit enough. I've now added an
example. This command won't do anything if placed at the top of a script,
when there's no output to flush. The idea is something like this:
<hansl>
loop i=1..n
# do some time-consuming operation
# print some results
if i < n
flush
endif
endloop
</hansl>
Allin