Skip to content
Snippets Groups Projects
Commit fad86785 authored by Johannes Pfeifer's avatar Johannes Pfeifer
Browse files

evaluate_planner_objective.m: do not evaluate non-existing terms for linear models

Closes #1781
parent 27ee801a
Branches
No related tags found
1 merge request!1864evaluate_planner_objective.m: do not evaluate non-existing terms for linear models
...@@ -98,11 +98,11 @@ if options_.ramsey_policy ...@@ -98,11 +98,11 @@ if options_.ramsey_policy
planner_objective_value(2) = W; planner_objective_value(2) = W;
else else
ys = oo_.dr.ys; ys = oo_.dr.ys;
if options_.order == 1 if options_.order == 1 || M_.hessian_eq_zero
[U] = feval([M_.fname '.objective.static'],ys,zeros(1,exo_nbr), M_.params); [U] = feval([M_.fname '.objective.static'],ys,zeros(1,exo_nbr), M_.params);
planner_objective_value(1) = U/(1-beta); planner_objective_value(1) = U/(1-beta);
planner_objective_value(2) = U/(1-beta); planner_objective_value(2) = U/(1-beta);
elseif options_.order == 2 elseif options_.order == 2 && ~M_.hessian_eq_zero
[U,Uy,Uyy] = feval([M_.fname '.objective.static'],ys,zeros(1,exo_nbr), M_.params); [U,Uy,Uyy] = feval([M_.fname '.objective.static'],ys,zeros(1,exo_nbr), M_.params);
Gy = dr.ghx(nstatic+(1:nspred),:); Gy = dr.ghx(nstatic+(1:nspred),:);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment