Optimal policy "NaN elements are present in the solution."

Dear all,

I am trying to solve my model under discretionary policy but the following error is appeared:

“Discretionary policy: NaN elements are present in the solution. Procedure failed.”

If I add the command “check;” before the command for discretion, the following error is appeared:

“Subscripted assignment dimension mismatch.
Error in stochastic_solvers (line 182)
b(:,cols_b) = jacobia_(:,cols_j);”

I attach my .mod file in case which someone wants to have a look in order to understand where the problem is. Just to give you the general picture of what I have/haven’t done:

  1. When I solve for stoch_simul or for osr, the Taylor rule (equation for the nominal interest rate) is present. When I calculate the optimal policy (Ramsey/discretion), I delete the Taylor rule. That is, when I solve for the optimal policy, I have one equation less. This is consistent with the suggestions of Dynare guide). We should get rid of the taylor rule when solve for optimal policy.

  2. Ramsey policy seems to work. Only discretion is problematic.

  3. I choose one instrument. I have tried many variables as instruments but no one works. I also tried more than one instruments. They do not work as well.

  4. The “model(linear);” command is used as it is required for discretion

  5. The planner objective is quadratic (some terms are in ^2 and some others are displayed as a product but this should be fine)

Thank you very much in advance,
discretion policy.mod (19.9 KB)

  1. The check command does not work with optimal policy as there is one instrument equation less here.
  2. You cannot do Ramsey with a linear model. The results are in general nonsense due to the naive linear-quadratic approach.
  3. Try working with a simpler version, i.e. use a simple objective and an instrument whose economics you understand and try to work from there. Given your complex objective it is not clear whether a finite value for the objective function exists.