Reference to non-existent field 'planner_objective_value'

Dear all,

I solve my model for the optimal discretionary policy and I am trying to store the value of the planner objective function. I get the following error message:

Reference to non-existent field ‘planner_objective_value’.

I use the dynare version 4.4.3. I have run the model diagnostics and they give back nothing (probably there is no mistake in the model).

Best,

Nikos

Please try the unstable version.

Dear Johannes,

I installed the unstable version, then opened matlab and typed addpath /usr/local/opt/dynare/lib/dynare/matlab. I still get the same error message “Reference to non-existent field ‘planner_objective_value’.”

I don’t know if it is relevant, but when I type the addpath /usr/… I get the following warning message:

Warning: Function bsxfun has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name
conflict.

In path at 109
In addpath at 86
Warning: Function ilu has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name
conflict.
In path at 109
In addpath at 86
Warning: Function ordeig has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name
conflict.
In path at 109
In addpath at 86

Thank you a lot,

Please let me say, that I figured out that this problem holds only under discretionary policy. I solved the Ramsey problem with the stable version and the command for the value of the objective function works.

Please provide the file to replicate the issue. This sounds like a bug.

Please find attached the mod file.
NK_ff_discretion.mod (7.9 KB)

The reason is that we do not save the objective function value for discretionary policy. We are going to change that in the future, see github.com/DynareTeam/dynare/issues/1041

Thank you very much for raising this issue .

Just to let you know, I tried to include the

oo_.planner_objective_value = evaluate_planner_objective(M_,options_,oo_);

to the discretionary_policy.m file and then I run the model again. I got the following error

Undefined function or variable “yhat2”.
Error in evaluate_planner_objective (line 95)
yhat2 = yhat2(dr.order_var(nstatic+(1:nspred)),1)-dr.ys(dr.order_var(nstatic+(1:nspred)));
Error in discretionary_policy (line 39)
oo_.planner_objective_value = evaluate_planner_objective(M_,options_,oo_);

Thank you again.

You need to change that file according to github.com/JohannesPfeifer/dynare/commit/cc3aeafd00f5135425dcc869e54a9c99c1e20790

Yes, I made the changes. It works perfectly. Thank you a lot for this.