evaluate_planner_objective.m: add warning if order>1 is used

Also modernizes output format
time-shift
Johannes Pfeifer 2019-12-13 14:27:55 +01:00
parent a4030c3676
commit c0c3a4c05c
1 changed files with 12 additions and 11 deletions

View File

@ -28,14 +28,17 @@ function planner_objective_value = evaluate_planner_objective(M,options,oo)
% You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>. % along with Dynare. If not, see <http://www.gnu.org/licenses/>.
if options.order>1
fprintf('\nevaluate_planner_objective: order>1 not yet supported\n')
planner_objective_value = NaN;
return
end
dr = oo.dr; dr = oo.dr;
exo_nbr = M.exo_nbr; exo_nbr = M.exo_nbr;
nstatic = M.nstatic; nstatic = M.nstatic;
nspred = M.nspred; nspred = M.nspred;
if nspred > 180 if nspred > 180
disp(' ') fprintf('\nevaluate_planner_objective: model too large, can''t evaluate planner objective\n')
disp(['WARNING in evaluate_planner_objective: model too large, can''t evaluate planner ' ...
'objective'])
planner_objective_value = NaN; planner_objective_value = NaN;
return return
end end
@ -109,15 +112,13 @@ if options.ramsey_policy
end end
if ~options.noprint if ~options.noprint
skipline() fprintf('\nApproximated value of planner objective function\n')
disp('Approximated value of planner objective function')
if options.ramsey_policy if options.ramsey_policy
disp([' - with initial Lagrange multipliers set to 0: ' ... fprintf(' - with initial Lagrange multipliers set to 0: %10.8f\n', ...
num2str(planner_objective_value(2)) ]) planner_objective_value(2))
disp([' - with initial Lagrange multipliers set to steady state: ' ... fprintf(' - with initial Lagrange multipliers set to steady state: %10.8f\n\n', ...
num2str(planner_objective_value(1)) ]) planner_objective_value(1))
elseif options.discretionary_policy elseif options.discretionary_policy
fprintf('with discretionary policy: %10.8f',planner_objective_value(1)) fprintf('with discretionary policy: %10.8f\n\n',planner_objective_value(1))
end end
skipline()
end end