Discretionary policy code problem

Dear all,
I am facing a problem running a code which replicates a model in the case of optimal policy conducted under discretion.
The problem is that I had to "shift’’ the time indices of the model so that Dynare could run the code. When I replace the
(annualized) nominal interest rate by the expected (annualized) nominal interest rate in period t-1 (I do it by using
expectation(-1)(i*4)), Dynare reports following errors:

??? Error using ==> print_info at 95
Discretionary policy: NaN elements are present in the solution. Procedure failed.

Error in ==> stoch_simul at 81
print_info(info, options_.noprint);

Error in ==> discretionary_policy at 25
info = stoch_simul(var_list);

Error in ==> PROVA2 at 210
discretionary_policy(var_list_);

Error in ==> dynare at 120
evalin(‘base’,fname) ;

model_diagnostics(M_,options_,oo_)
The following endogenous variables aren’t present at the current period in the model:
i

Clearly, the problem is that the nominal interest rate i does not appear at the current period.
Any suggestion on how to amend this problem?

In the attachment you can find the dynare code. Any feedback would be highly appreciated.
Thank you very much in advance :slight_smile:

Best,
francis

P.S. I use the unstable version released on July 3rd since there was a bug relating to the
command discretionary_policy in version 4.3.0 (see Problem "discretionary_policy" Dynare 4.3.0).
PROVA2.mod (1.02 KB)