🐛 sim1_lbj.m: use options_.dynatol.x and not options_.dynatol.f for terminal condition

The maximum error is computed over the change in endogenous (i.e. ΔY).
kalman_mex
Sébastien Villemot 2023-11-08 15:49:39 +01:00
parent 4bee919c31
commit 0839ff78ae
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
1 changed files with 7 additions and 2 deletions

View File

@ -4,8 +4,13 @@ function [endogenousvariables, success, err, iter] = sim1_lbj(endogenousvariable
%
% INPUTS
% ...
%
% OUTPUTS
% ...
% endogenousvariables [matrix] All endogenous variables of the model
% success [logical] Whether a solution was found
% err [double] ∞-norm of Δendogenousvariables
% iter [integer] Number of iterations
%
% ALGORITHM
% Laffargue, Boucekkine, Juillard (LBJ)
% see Juillard (1996) Dynare: A program for the resolution and
@ -96,7 +101,7 @@ for iter = 1:options_.simul.maxit
if verbose
fprintf('Iter: %s,\t err. = %s, \t time = %s\n', num2str(iter), num2str(err), num2str(etime(clock, h2)));
end
if err < options_.dynatol.f
if err < options_.dynatol.x
success = true; % Convergency obtained.
break
end