Error Message after adding OSR in EHL 2000

Hey,
I am trying to replicate the dynare code for the model of Erceg, Henderson and Levin (2000) with the calibration from the textbook of Gali “Monetary Policy, Inflation and the Business Cycle” 2008

If i try to compute the parameter for an optimal monetary policy by inserting this passage

*optim_weights;
pip ep/lambdap;
piw ew
(1-alpha)/lambdaw;
x sigma+(phi+alpha)/(1-alpha);
end;

osr_params phip;
phip = 1.5;

osr(irf=20) pip pip x;**

I always get the error message:

**OPTIMAL SIMPLE RULE

??? Reference to non-existent field ‘ys’.

Error in ==> osr1 at 67
[dr.ys,check1] = dynare_solve(fh,dr.ys,options_.jacobian_flag,…

Error in ==> osr at 47
osr1(i_params,i_var,W);

Error in ==> stickywages3osr at 199
osr(var_list_,osr_params_,obj_var_,optim_weights_);

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

I think, there is something wrong with my original model (not the osr-part i added). I attached the original model file too. This mod.file can be calculated with dynare without problems, but i still think there is something wrong with it, because it depicts a negative output gap and in Gali (2008) the output gap is positive.

I hope someone can help me.
Best regard
Tina
stickywages3.mod (1.26 KB)
stickywages3osr.mod (1.42 KB)

Hi,

in both mod-files you forgot to associate in the simple rule the inertial degree “rho” with the interest rate at time t-1 “i(-1)”.
To see this, you need to check the residuals. Even though Dynare is able to compute the steady steate, the command “resid(1)” show
you that equation 10 doesnt hold (the residual is =100).

Im attaching the corrected file, and now dynare can compute the optimal simple rule

Also, note that since your model is linear, it is more convenient to specify this in the block model as follows “model(linear)”

Best
stickywages3.mod (1.29 KB)
stickywages3osr.mod (1.47 KB)