Adding ZLB constraint to chapter 3

Hello,

I am trying to add a ZLB constraint to the chapter 3 codes from GALI 2015. However, it dont eem like the constraints are binding when i run the model because there is no changes. Ive also changed the sign on the interest rate policy equation because i want to check for expansionary monetary policy. Ive added inom as a variable and inomlb as a parameter with the value 1.

I used this side for help: tests/occbin/filter/NKM.mod · master · Dynare / dynare · GitLab

Please help me understand why this is not binding, thank you.

@#define money_growth_rule=0
var pi          ${\pi}$                 (long_name='inflation')
    y_gap       ${\tilde y}$            (long_name='output gap')
    y_nat       ${y^{nat}}$             (long_name='natural output')      //(in contrast to the textbook defined in deviation from steady state)
    y           ${y}$                   (long_name='output')
    yhat        ${\hat y}$              (long_name='output deviation from steady state')
    r_nat       ${r^{nat}}$             (long_name='natural interest rate')
    r_real      ${r^r}$                 (long_name='real interest rate')     
    i           ${i}$                   (long_name='nominal interrst rate')
    n           ${n}$                   (long_name='hours worked')
    m_real      ${m-p}$                 (long_name='real money stock')
    m_growth_ann ${\Delta m}$           (long_name='money growth annualized')
    m_nominal   ${m}$                   (long_name='nominal money stock')
    @#if money_growth_rule==0
        nu      ${\nu}$                 (long_name='AR(1) monetary policy shock process')    
    @#else
        money_growth  ${\Delta m_q}$    (long_name='money growth')
        money_growth_ann  ${\Delta m^{ann}}$    (long_name='money growth annualized')
   @#endif
    a           ${a}$                   (long_name='AR(1) technology shock process')
    r_real_ann  ${r^{r,ann}}$           (long_name='annualized real interest rate')
    i_ann       ${i^{ann}}$             (long_name='annualized nominal interest rate')
    r_nat_ann   ${r^{nat,ann}}$         (long_name='annualized natural interest rate')
    pi_ann      ${\pi^{ann}}$           (long_name='annualized inflation rate')
    z           ${z}$                   (long_name='AR(1) preference shock process')
    p           ${p}$                   (long_name='price level')
    w           ${w}$                   (long_name='nominal wage')
    c           ${c}$                   (long_name='consumption')
    w_real      ${\frac{w}{p}}$         (long_name='real wage')
    mu          ${\mu}$                 (long_name='markup')
    mu_hat      ${\hat \mu}$            (long_name='markup gap')
    inom    ${i^{nom}}$ (long_name='Nominal interest  or')
    
;     



%%% EXOGENOUS SHOCKS 
varexo  eps_a       ${\varepsilon_a}$       (long_name='technology shock')
        @#if money_growth_rule==0
            eps_nu  ${\varepsilon_\nu}$     (long_name='monetary policy shock')
        @#else   
            eps_m       ${\varepsilon_m}$   (long_name='money supply shock innovation')
        @#endif
        eps_z       ${\varepsilon_z}$   (long_name='preference shock innovation')
       ;


%%%% OUR PARAMETERS (will have to add the parameters in our deposit fee etc)
parameters alppha       ${\alpha}$     (long_name='capital share')
    betta               ${\beta}$       (long_name='discount factor')
    rho_a               ${\rho_a}$      (long_name='autocorrelation technology shock')
    @#if money_growth_rule==0
        rho_nu          ${\rho_{\nu}}$  (long_name='autocorrelation monetary policy shock')
    @#else   
        rho_m        ${\rho_{\zeta}}$ (long_name='autocorrelation monetary demand shock')
    @#endif
    rho_z               ${\rho_{z}}$    (long_name='autocorrelation preference shock')
    siggma              ${\sigma}$      (long_name='inverse EIS')
    varphi              ${\varphi}$     (long_name='inverse Frisch elasticity')
    phi_pi              ${\phi_{\pi}}$  (long_name='inflation feedback Taylor Rule')
    phi_y               ${\phi_{y}}$    (long_name='output feedback Taylor Rule')
    eta                 ${\eta}$        (long_name='semi-elasticity of money demand')
    epsilon             ${\epsilon}$    (long_name='demand elasticity')
    theta               ${\theta}$      (long_name='Calvo parameter')
    inomlb              ${i_nomlb}$     (long_name='Effective lower bound on gross nominal interest rate')
    ;
%----------------------------------------------------------------
% Parametrization, p. 67-75
%----------------------------------------------------------------

%%%% WE CAN USE THE SAME PARAMETERIZATION BUT WE WILL CHANGE THEM TOO 


siggma = 1;         %p. 67
varphi=5;           %p. 67, Frisch elasticity of 0.2
phi_pi = 1.5;       %p. 68 
phi_y  = 0.125;     %p. 68 (5/4)
theta=3/4;          %p. 67
@#if money_growth_rule==0
    rho_nu =0.5;    %p. 68
@#else   
    rho_m=0.5;      %p. 75
@#endif
rho_z  = 0.5;       %p. 70
rho_a  = 0.9;       %p. 72
betta  = 0.99;      %p. 67
eta  =3.77; %footnote 11, p. 115
alppha=1/4;     	%p. 67
epsilon=9;          %p. 67
inomlb= 1 ;         // Inom LB

%----------------------------------------------------------------
% First Order Conditions
%----------------------------------------------------------------

model(linear); 
//Composite parameters
#Omega=(1-alppha)/(1-alppha+alppha*epsilon);        %defined on page 60
#psi_n_ya=(1+varphi)/(siggma*(1-alppha)+varphi+alppha);   %defined on page 62
#lambda=(1-theta)*(1-betta*theta)/theta*Omega;      %defined on page 61
#kappa=lambda*(siggma+(varphi+alppha)/(1-alppha));     %defined on page 63
[name='New Keynesian Phillips Curve eq. (22)']
pi=betta*pi(+1)+kappa*y_gap;
[name='Dynamic IS Curve eq. (23)']
y_gap=-1/siggma*(i-pi(+1)-r_nat)+y_gap(+1);
@#if money_growth_rule==0
    [name='Interest Rate Rule eq. (26)']
    i=phi_pi*pi+phi_y*yhat+nu;
@#endif
[name='Definition natural rate of interest eq. (24)']
r_nat=-siggma*psi_n_ya*(1-rho_a)*a+(1-rho_z)*z;
[name='Definition real interest rate']
r_real=i-pi(+1);
[name='Definition natural output, eq. (20)']
y_nat=psi_n_ya*a;
[name='Definition output gap']
y_gap=y-y_nat;
@#if money_growth_rule==0
    [name='Monetary policy shock']
    nu=rho_nu*nu(-1)- eps_nu;
@#endif
[name='TFP shock']
a=rho_a*a(-1)+eps_a;
[name='Production function (eq. 14)']
y=a+(1-alppha)*n;
[name='Preference shock, p. 54']
z     = rho_z*z(-1) - eps_z;
[name='Money growth (derived from eq. (4))']
m_growth_ann=4*(y-y(-1)-eta*(i-i(-1))+pi);
@#if money_growth_rule==1
    [name='Real money demand, eq. (4)']
    m_real=y-eta*i;
    [name='definition nominal money growth']
    money_growth=m_real-m_real(-1)+pi;
    [name='exogenous process for money supply growth rate, eq. (35)']
    money_growth=rho_m*money_growth(-1)+eps_m;
    [name='definition annualized nominal money growth'] 
    money_growth_ann=4*money_growth;
@#else
    [name='Real money demand (eq. 4)']
    m_real=y-eta*i;
@#endif
[name='Annualized nominal interest rate']
i_ann=4*i;
[name='Annualized real interest rate']
r_real_ann=4*r_real;
[name='Annualized natural interest rate']
r_nat_ann=4*r_nat;
[name='Annualized inflation']
pi_ann=4*pi;
[name='Output deviation from steady state']
yhat=y-steady_state(y);
[name='Definition price level']
pi=p-p(-1);
[name='resource constraint, eq. (12)']
y=c;
[name='FOC labor, eq. (2)']
w-p=siggma*c+varphi*n;
[name='definition real wage']
w_real=w-p;
[name='definition nominal money stock']
m_nominal=m_real+p;
[name='average price markup, eq. (18)']
mu=-(siggma+(varphi+alppha)/(1-alppha))*y+(1+varphi)/(1-alppha)*a;
[name='average price markup, eq. (20)']
mu_hat=-(siggma+(varphi+alppha)/(1-alppha))*y_gap;

[name = 'Nominal Interest Rate (10)', bind='zlb']
inom = inomlb;
[name = 'Nominal Interest Rate (10)', relax='zlb']
inom = i;
end;

options_.TeX=1;
occbin_constraints;
name 'zlb'; bind inom <=  inomlb; relax inom > inomlb;
end;



%----------------------------------------------------------------
%  define shock variances
%---------------------------------------------------------------


shocks;
    @#if money_growth_rule==0
        var eps_nu = 0.25^2; //1 standard deviation shock of 25 basis points, i.e. 1 percentage point annualized
    @#else   
        var eps_m = 0.25^2; //1 standard deviation shock of 25 basis points, i.e. 1 percentage point annualized
    @#endif
end;

%----------------------------------------------------------------
%  steady states: all 0 due to linear model
%---------------------------------------------------------------
resid;
steady;
check;

%----------------------------------------------------------------
% generate IRFs for monetary policy shock, replicates Figures 3.1, p. 69 (interest rate rule)
% 3.4, p. 76 (money supply rule)
%----------------------------------------------------------------
@#if money_growth_rule==0
    stoch_simul(order = 1,irf=15) y_gap pi_ann y n w_real p i_ann r_real_ann m_nominal nu;
@#else
    stoch_simul(order = 1,irf=15) y_gap pi_ann y n w_real p i_ann r_real_ann m_nominal money_growth_ann;
@#endif


%----------------------------------------------------------------
% generate IRFs for discount rate shock, replicates Figures 3.2, p. 70 (interest rate rule)
% 3.5, p. 78 (money supply rule)
%----------------------------------------------------------------
shocks;
    @#if money_growth_rule==0
        var eps_nu = 0;   //shut off monetary policy shock
    @#else   
        var eps_m = 0;   //shut off monetary policy shock
    @#endif
var eps_z  = 0.5^2; //unit shock to preferences 
end;

stoch_simul(order = 1,irf=15,irf_plot_threshold=0) y_gap pi_ann y n w_real p i_ann r_real_ann m_nominal z;


%----------------------------------------------------------------
% generate IRFs, replicates Figures 3.3, p. 73 (interest rate rule)
% 3.6, p. 81 (money supply rule)
%----------------------------------------------------------------
shocks;
    @#if money_growth_rule==0
        var eps_z = 0;   //shut off preference shock
    @#else   
        var eps_z = 0;   //shut off preference shock
    @#endif
var eps_a  = 1^2; //unit shock to technology
end;

stoch_simul(order = 1,irf=15,irf_plot_threshold=0) y_gap pi_ann y n w_real p i_ann r_real_ann m_nominal a;

The stoch_simul command is not for OccBin. See the Dynrae manual and the bottom part of

Thank you, i checked the codes and the dynare manual and ive changed it into this for the first shock. But I still get errors:

shocks(surprise);

var eps_nu;

periods 1:15;

values 0.0625;

end;

occbin_setup;

occbin_solver(simul_periods=15,simul_check_ahead_periods=15);

occbin_graph y_gap pi_ann y n w_real p i_ann r_real_ann m_nominal nu;

The errors:
Error using print_info (line 33)
Occbin: Simulation did not converge, increase maxit or check_ahead_periods.
Error in occbin.solver (line 91)
print_info(error_flag, options_.noprint, options_)
Error in chap3_zlb.driver (line 596)
[oo_.dr, oo_.occbin.simul]= occbin.solver(M_, options_, oo_.dr , oo_.steady_state, oo_.exo_steady_state, oo_.exo_det_steady_state);
Error in dynare (line 310)
evalin(‘base’,[fname ‘.driver’]);

Please provide the new files.

chap3_zlb.mod (8.4 KB)

I only applied it to one shock (nu) to begin with

I am not sure what you are doing. In a linearized model where the steady state interest is 0, you cannot have inomlb=1. It needs to be

inomlb= -(1/betta -1);         // Inom LB

Also, how can you use a monetary policy shock to induce the ZLB to bind?

I added inomlb = 1 because this is what i found in:

I was thinking that with an expansionary monetary policy, the monetary policy shock would induce the ZLB to bind. Is this wrong

  1. That model is not linearized.
  2. The ZLB means you cannot lower the interest rate below 0. At this point, no more shock can happen. People use discount factor shocks for that.
  1. Thank you, that makes sense
  2. In the original model of chapter_3 from Gali (2015) there is no ZLB constraint in the model, I wanted to see if there was any changes in the models outputs after adding a ZLB constraint. I tought i could capture this by shocking the model with monetary policy shock (and later preference shock and technology shock)

Hi, is there any other ways to implement a ZLB constraint to the Chap_3 mod file? I really want to see the difference with and without a ZLB constraint on the shocks.

Try Gali_Chapter_3_ZLB.mod (8.1 KB)

Thank you professor! Since it is only applied discount factor shock to the model, does this mean that monetary policy shock and technology shock do not have any impact on the ZLB constraint? I would think that the monetary policy shock would be able to make the interest rate to go below zero without any constraint.

Why would you think that? A monetary policy shock can only lower to interest rate to 0 but not below that. A TFP shock can trigger the ZLB.

My main idea was to see the difference in the variables as output gap, annualized inflation rate, etc. before and after we add the ZLB constraint. I was thinking that without the ZLB constraint, a monetary policy shock could lower the interest rate below 0.But when we add the ZLB constraint it cannot be lowered below 0 anymore. And i wanted to see the changes in the outputs on this. This is why I also wanted to use the stoch_simul to see what happens to the variables.

This is why i wondered why the other shocks is not considered when adding the ZLB constraint.

You can look at the comparison but it’s not really interesting because the two shocks must necessarily be different. You could introduce such a shock to the notional interest rate but the question would be what the interpretation is.

I am so sorry for so many question, i am a beginner in matlab/dynare, what do you mean by that the two shocks must be different. I will try to explain more in depth again, maybe that will make it clearer what I am trying to do. I think i have tried to explain this before in another post.

I have used the GALI chap 3 as a baseline model to make a new model which includes CBDC (this is the unit of account), and paper currency which we will apply a deposit fee to so that people do not hoard cash in times with negative interest rate.

My goal is to see the effect with CBDC and deposit fee, without ZLB, VS. a model with ZLB.

I want to compare the Chapter_3.mod file to my new model and look at the differences of outputs.

However there is no ZLB in the chapter_3 file and this is why I wanted to add a constraint to the interest rate.

My point is: take a central bank that is unable to lower the interest rate below the ZLB. Why would it ever follow a Taylor rules that includes a shock implying the interest falls below zero?

Without the ZLB, you can pretend the central bank does exactly that. But with the ZLB, the shock cannot drop the interest rate below zero. Thus, they are different.