Page 1 of 1

Reference to non-existent field 'planner_objective_value'.

PostPosted: Mon Aug 24, 2015 7:02 pm
by nk178
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

Re: Reference to non-existent field 'planner_objective_value

PostPosted: Tue Aug 25, 2015 4:43 am
by jpfeifer
Please try the unstable version.

Re: Reference to non-existent field 'planner_objective_value

PostPosted: Tue Aug 25, 2015 5:59 pm
by nk178
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,

Re: Reference to non-existent field 'planner_objective_value

PostPosted: Tue Aug 25, 2015 6:08 pm
by nk178
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.

Re: Reference to non-existent field 'planner_objective_value

PostPosted: Tue Aug 25, 2015 6:34 pm
by jpfeifer
Please provide the file to replicate the issue. This sounds like a bug.

Re: Reference to non-existent field 'planner_objective_value

PostPosted: Tue Aug 25, 2015 6:40 pm
by nk178
Please find attached the mod file.

Re: Reference to non-existent field 'planner_objective_value

PostPosted: Wed Aug 26, 2015 7:59 am
by jpfeifer
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 https://github.com/DynareTeam/dynare/issues/1041

Re: Reference to non-existent field 'planner_objective_value

PostPosted: Wed Aug 26, 2015 12:27 pm
by nk178
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.

Re: Reference to non-existent field 'planner_objective_value

PostPosted: Wed Aug 26, 2015 12:44 pm
by jpfeifer

Re: Reference to non-existent field 'planner_objective_value

PostPosted: Wed Aug 26, 2015 2:07 pm
by nk178
Yes, I made the changes. It works perfectly. Thank you a lot for this.