Hi everyone,
I am trying to solve a simple linear NK model at the ZLB, using the OCCBIN toolkit. I think I am missing something because I get exactly the same IRFS for the linear and for the piecewise solution. Here is my “runsim” code, could anyone help me understand whats wrong?

global M_ oo_

modnam = 'NIBNIL';
modnamstar = 'NIBNIL_ZLB';

constraint = 'irate <(1-Rss)';
constraint_relax ='iratenot >(1-Rss)';

% Pick innovation for IRFs
irfshock =char('epssigma');      % label for innovation for IRFs
shockssequence = [1; zeros(30,1)];
nperiods = 30;

% Solve model, generate model IRFs
[zdatalinear zdatapiecewise zdatass oobase_ Mbase_  ] = ...
  constraint, constraint_relax,...

% unpack the IRFs                          
for i=1:M_.endo_nbr

% define inputs for plotting
titlelist = char('prod (GDP)','prodfor (Foreign GDP)','irate (Interest rate)','bgdp (Private debt)');
percent = 'Percent';
level = 'Level';
ylabels = char(percent,percent,percent,percent,level);
figtitle = '';
legendlist = cellstr(char('Piecewise Linear','Linear'));

% create plots

Thank you!

Hi mmalmi,

could you post your files?

Sure. fomega2 and fomega2open are two functions used for the steady state calculation (NIBNIL_ss). Then the mod files use the values stored after running NIBNIL_ss

fomega2.m (821 Bytes) fomega2open.m (660 Bytes) NIBNIL.mod (24.0 KB) NIBNIL_ss.m (22.1 KB) NIBNIL_ZLB.mod (16.8 KB) runsim_NIBNIL_2.m (1.6 KB)

If I choose scenario = 1, then there seems to be no mistake.
min(irate_p) = -3.588068554181867e-04 and hence there is no violation of the ZLB (which is attained at 1-Rss =-0.017415534656914). Obtaining the exact same IRFs is correct in this case.

But I should note that the overall implementation looks strange to me.
Why do you set an initval-block and compute steady states if you have the (linear) option set in the model block?

The problem arises when choosing scenario 4. The initval block is redundant, that’s right, but even eliminating it I get the same result…

So, is there probably an error with the constraint that I am implementing?

Again, there is no problem since min(irate_p) = -0.002998584497758.
Note that your IRF is scaled by 100, hence the interest rate almost reaches -0.3
But there is again no binding ZLB!

Ok Max. Thank you for your answer.
So that means that my constraint is not correctly written in the code right? I could not have an interest rate that reaches -0.3 if there is a ZLB correctly implemented right?
Thank you again!

No, it means there is no problem. Everything seems to work as expected. Your graph is scaled by 100, hence the interest rate can go to -1.74 without violating the ZLB.

You should note that you are expressing the interest rate in deviation from the steady state (both, within your graph and your constraint).
If the interest rate is zero, then the interest rate in deviation from steady state should be (1-Rss).

Thank you Max! Now it is more clear!