perfect_foresight_with_expectation_errors_solver: check convergence of informational iterations

Error out if an iteration failed.

Also display an informative message about those iterations.
remove-submodule
Sébastien Villemot 2023-06-15 16:57:59 +02:00
parent 018f69b69b
commit d4b5e156d1
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
1 changed files with 8 additions and 0 deletions

View File

@ -40,6 +40,10 @@ else
initial_steady_state = ys0_;
end
while info_period <= periods
if ~options_.noprint
fprintf('perfect_foresight_with_expectations_errors_solver: computing solution for information available at period %d\n', info_period)
end
% Compute terminal steady state as anticipated
oo_.exo_steady_state = oo_.pfwee.terminal_info(:, info_period);
oo_.steady_state = oo_.pfwee.terminal_steady_state(:, info_period);
@ -68,6 +72,10 @@ while info_period <= periods
perfect_foresight_solver;
if ~oo_.deterministic_simulation.status
error('perfect_foresight_with_expectation_errors_solver: failed to compute solution for information available at period %d\n', info_period)
end
endo_simul(:, info_period:end) = oo_.endo_simul;
exo_simul(info_period:end, :) = oo_.exo_simul;