Added an option to skip the test on the number of periods over which the perfect foresight models are solved.
parent
3f2d2b3497
commit
8a35ee7363
|
@ -81,6 +81,10 @@ pfm.i_upd = pfm.ny+(1:pfm.periods*pfm.ny);
|
||||||
% Set the algorithm for the perfect foresight solver
|
% Set the algorithm for the perfect foresight solver
|
||||||
options_.stack_solve_algo = options_.ep.stack_solve_algo;
|
options_.stack_solve_algo = options_.ep.stack_solve_algo;
|
||||||
|
|
||||||
|
% Set check_stability flag
|
||||||
|
do_not_check_stability_flag = ~options_.ep.check_stability;
|
||||||
|
|
||||||
|
|
||||||
% Compute the first order reduced form if needed.
|
% Compute the first order reduced form if needed.
|
||||||
%
|
%
|
||||||
% REMARK. It is assumed that the user did run the same mod file with stoch_simul(order=1) and save
|
% REMARK. It is assumed that the user did run the same mod file with stoch_simul(order=1) and save
|
||||||
|
@ -248,6 +252,11 @@ while (t<sample_size)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if do_not_check_stability_flag
|
||||||
|
% Exit from the while loop.
|
||||||
|
oo_.endo_simul = tmp;
|
||||||
|
break
|
||||||
|
else
|
||||||
% Test if periods is big enough.
|
% Test if periods is big enough.
|
||||||
% Increase the number of periods.
|
% Increase the number of periods.
|
||||||
options_.periods = options_.periods + options_.ep.step;
|
options_.periods = options_.periods + options_.ep.step;
|
||||||
|
@ -326,6 +335,7 @@ while (t<sample_size)
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
end% if info.convergence
|
end% if info.convergence
|
||||||
|
end
|
||||||
end% while
|
end% while
|
||||||
if ~info.convergence% If exited from the while loop without achieving convergence, use an homotopic approach
|
if ~info.convergence% If exited from the while loop without achieving convergence, use an homotopic approach
|
||||||
[INFO,tmp] = homotopic_steps(.5,.01);
|
[INFO,tmp] = homotopic_steps(.5,.01);
|
||||||
|
|
|
@ -126,6 +126,8 @@ ep.maxit = 500;
|
||||||
ep.periods = 200;
|
ep.periods = 200;
|
||||||
% Default step for increasing the number of periods if needed
|
% Default step for increasing the number of periods if needed
|
||||||
ep.step = 50;
|
ep.step = 50;
|
||||||
|
% Set check_stability flag
|
||||||
|
ep.check_stability = 1;
|
||||||
% Define last periods used to test if the solution is stable with respect to an increase in the number of periods.
|
% Define last periods used to test if the solution is stable with respect to an increase in the number of periods.
|
||||||
ep.lp = 5;
|
ep.lp = 5;
|
||||||
% Define first periods used to test if the solution is stable with respect to an increase in the number of periods.
|
% Define first periods used to test if the solution is stable with respect to an increase in the number of periods.
|
||||||
|
|
Loading…
Reference in New Issue