Skip to content
Snippets Groups Projects
Commit 8887822f authored by MichelJuillard's avatar MichelJuillard
Browse files

fix bug with lag on exogenous variables on more than one period

parent d3af0839
No related branches found
No related tags found
No related merge requests found
...@@ -38,13 +38,13 @@ dynamicmodel = str2func([M.fname,'.dynamic']); ...@@ -38,13 +38,13 @@ dynamicmodel = str2func([M.fname,'.dynamic']);
info.status = 1; info.status = 1;
for it = 2:options.periods+1 for it = M.maximum_lag + (1:options.periods)
yb = endogenousvariables(:,it-1); % Values at previous period, also used as guess value for current period yb = endogenousvariables(:,it-1); % Values at previous period, also used as guess value for current period
yb1 = yb(iyb); yb1 = yb(iyb);
[tmp, check] = solve1(dynamicmodel, [yb1; yb], 1:M.endo_nbr, nyb+1:nyb+M.endo_nbr, ... [tmp, check] = solve1(dynamicmodel, [yb1; yb], 1:M.endo_nbr, nyb+1:nyb+M.endo_nbr, ...
1, options.gstep, options.dynatol.f, options.dynatol.x, ... 1, options.gstep, options.dynatol.f, options.dynatol.x, ...
options.simul.maxit, options.debug, exogenousvariables, ... options.simul.maxit, options.debug, exogenousvariables, ...
M.params, steadystate, it+M.maximum_lag-1); M.params, steadystate, it);
if check if check
info.status = 0; info.status = 0;
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment