evaluate_planner_objective.m: fix wrong timing in setting of shocks

pac-components
Johannes Pfeifer 2021-09-11 09:41:08 +02:00
parent 0d483ff85f
commit 334020fc46
2 changed files with 9 additions and 5 deletions

View File

@ -347,11 +347,15 @@ if ~isempty(M_.det_shocks)
end
u =oo_.exo_steady_state;
periods=[M_.det_shocks(:).periods];
if ~all(periods==0)
fprintf(['\nevaluate_planner_objective: Shock values for periods other than the intial period 0 have been provided.\n' ...
if any(periods==0)
fprintf(['\nevaluate_planner_objective: M_.det_shocks contains values for the predetermined t=0 period.\n'...
'evaluate_planner_objective: Dynare will ignore them. Use histval to set the value of lagged innovations.\n'])
end
if any(periods>1)
fprintf(['\nevaluate_planner_objective: Shock values for periods not contained in the initial information set (t=1) have been provided.\n' ...
'evaluate_planner_objective: Note that they will be ignored.\n'])
end
shock_indices=find(periods==0);
shock_indices=find(periods==1);
if any([M_.det_shocks(shock_indices).multiplicative])
fprintf(['\nevaluate_planner_objective: Shock values need to be specified as additive.\n'])
end

View File

@ -37,8 +37,8 @@ end;
shocks;
var u; stderr 0.008;
var u;
periods 0;
values 1;
periods 0, 1;
values 1, 1;
end;
options_.dr_display_tol=0;
planner_objective(ln(c)-phi*((n^(1+gamma))/(1+gamma)));