Commit f97c1386 authored by Johannes Pfeifer 's avatar Johannes Pfeifer
Browse files

sim1_purely_backward.m: for purely static model, do not use past value for first iteration

Index 0 does not exist.
parent abe8a05b
...@@ -43,8 +43,13 @@ dynamicmodel_s = str2func('dynamic_backward_model_for_simulation'); ...@@ -43,8 +43,13 @@ dynamicmodel_s = str2func('dynamic_backward_model_for_simulation');
info.status = true; info.status = true;
for it = M.maximum_lag + (1:options.periods) for it = M.maximum_lag + (1:options.periods)
y = endogenousvariables(:,it-1); % Values at previous period, also used as guess value for current period if M.maximum_lag==0 && it==1
ylag = y(iyb); y = endogenousvariables(:,it); % Values at previous period, also used as guess value for current period
ylag = [];
else
y = endogenousvariables(:,it-1); % Values at previous period, also used as guess value for current period
ylag = y(iyb);
end
if ismember(options.solve_algo, [12,14]) if ismember(options.solve_algo, [12,14])
[tmp, check] = dynare_solve(dynamicmodel_s, y, options, M.isloggedlhs, M.isauxdiffloggedrhs, M.endo_names, M.lhs, ... [tmp, check] = dynare_solve(dynamicmodel_s, y, options, M.isloggedlhs, M.isauxdiffloggedrhs, M.endo_names, M.lhs, ...
dynamicmodel, ylag, exogenousvariables, M.params, steadystate, it); dynamicmodel, ylag, exogenousvariables, M.params, steadystate, it);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment