Fixed bug. If info==19 (steady state routine returns check=1) info(2) is NaN, so that it is not possible to define an endogenous penalty. In this case we just add one to objective_function_penalty_base.

(cherry picked from commit d2912b264c326b3f349984b605787045b028b992)
time-shift
Stéphane Adjemian (Scylla) 2012-09-14 17:01:05 +02:00
parent c74b1d1bdc
commit 3658b02455
1 changed files with 2 additions and 2 deletions

View File

@ -248,7 +248,7 @@ end
% Return, with endogenous penalty when possible, if dynare_resolve issues an error code (defined in resol).
if info(1) == 1 || info(1) == 2 || info(1) == 5 || info(1) == 7 || info(1) ...
== 8 || info(1) == 22 || info(1) == 24
== 8 || info(1) == 22 || info(1) == 24 || info(1) == 19
fval = objective_function_penalty_base+1;
info = info(1);
exit_flag = 0;
@ -256,7 +256,7 @@ if info(1) == 1 || info(1) == 2 || info(1) == 5 || info(1) == 7 || info(1) ...
DLIK=ones(length(xparam1),1);
end
return
elseif info(1) == 3 || info(1) == 4 || info(1)==6 ||info(1) == 19 || info(1) == 20 || info(1) == 21 || info(1) == 23
elseif info(1) == 3 || info(1) == 4 || info(1)==6 || info(1) == 20 || info(1) == 21 || info(1) == 23
fval = objective_function_penalty_base+info(2);
info = info(1);
exit_flag = 0;