Solving for Non-linear Transitions: Forward Guidance under ZLB (McKay, Nakamura, Steinsson, 2016)
In this example, we solve the one-asset HANK model used by McKay, Nakamura, and Steinsson (2016) to study the forward guidance of monetary policy at the liquidity trap (nominal interest rate zero lower bound). The liquidity trap is driven by a positive shock to the common discount factor of households. The forward guidance is modeled as the central bank’s commitment to setting the nominal interest rate at zero for additional periods, after the economy would have exited the zero lower bound.
The example is used to demonstrate the capability of the toolbox in solving highly non-linear models. In particular, the equilibrium system at the liquidity trap is very different from that out of the liquidity trap, posing challenges to traditional solution methods.
We follow the parameterization and notation of their original paper.
The Model
Households decision problems
Households are heterogeneous in their labor efficiency \(e\), which follows a stationary Markov chain, and real bonds holding \(b\). They solve the Bellman equation:
where \(r_t\) is the real interest rate, \(w_t\) the wage rate, \(\tau_t\) the tax level, and \(D_t\) the profits of firms. \(\bar{\tau}(e)\) takes value 0 or 1, which specifies whether a household with labor efficiency type \(e\) is taxed. Households choose consumption \(c\), labor supply \(n\) and future bond holding \(b'\), subject to a no borrowing constraint \(b' \geq 0\).
Denote the measure that represents the distribution over households states by \(\Gamma_t\), and policy functions by \(g_{c,t},g_{n,t},g_{b',t}\).
The New-Keynesian block
Intermediate goods firms use labor to produce differentiated goods, which are aggregated by final goods firms using a CES aggregator. Intermediate goods firms engage in monopolistic competition and face price adjustment frictions a la Calvo. The New Keynesian Phillips curve is characterized by the following system (see their paper or any monetary textbook for derivations):
where \(\mu\) is the elasticity of substitution, \(\theta\) is the probability of the opportunity for price adjustment. \(Y_t\) is aggregate output, \(S_t\) is the dispersion of prices, \(N_t\) is aggregate labor demand, \(z_t\) is the exogenous labor productivity, \(\pi_t\) is the inflation rate, \(p_t^*\) is firms’ ideal price when adjusting, and \(P_t^A,P_t^B\) are auxiliary variables that facilitate the definition of the system.
The monetary authority implements a Taylor rule subject to a zero lower bound on the nominal interest rate:
Since there is no aggregate uncertainty, the Fisher equation holds:
Government set taxes \(\tau_t\) to finance exogenous spending and interest payment on bonds:
where \(B_t\) is the government bond outstanding at the beginning of period \(t\) and \(G_t\) is the government spending.
In their benchmark specification, the fiscal rule supplies a fixed amount of government bond \(B_{t+1}=\overline{B}\).
Market clearing conditions
Bonds market clearing:
Labor market clearing:
and goods market clearing:
Definition of equilibrium
Given an initial distribution over households states, \(\Gamma_0\), a sequential competitive equilibrium is a sequence of (1) distributions over households states \(\{\Gamma_t\}_{t=0}^{\infty}\), (2) households’ value and policy functions \(\{V_t,g_{c,t},g_{n,t},g_{b',t}\}_{t=0}^{\infty}\), and (3) aggregate quantities and prices \(\{w_t,Y_t,S_t,N_t,D_t,\pi_t,\frac{p_t^*}{P_t},P_t^A,P_t^B,r_t,i_t,\tau_t\}_{t=0}^{\infty}\) such that
and goods market clearing implied by Walras’s law. The system can be further simplified. See the hmod file below that defines the simplified system of equations.
The hmod File
The model can be represented using a hmod file, hank1.hmod
, listed below
1parameters beta gamma nu chi w r D tau;
2beta = 0.986;
3gamma = 2;
4nu = 0.5;
5chi = 1;
6
7var_shock e taxed;
8shock_trans = [
9 0.9663 0.0334 0.0003
10 0.0167 0.9666 0.0167
11 0.0003 0.0334 0.9663
12 ];
13e = [0.49008,1,2.0405];
14taxed = [0, 0, 1];
15
16var_state b;
17b_min = 0.0;
18b_max = 50.0;
19b_pts = 201;
20b_shift = 0.1;
21b = exp(linspace(log(b_min+b_shift),log(b_max+b_shift),b_pts)) - b_shift;
22
23var_pre_vfi budget_n1;
24budget_n1 = b + w*e - tau*taxed + D;
25
26var_policy c bp n;
27initial c budget_n1;
28initial bp 0;
29initial n 1;
30
31var_aux ne;
32
33vfi;
34 u = c^(1-gamma)/(1-gamma) - chi*n^(1+1/nu)/(1+1/nu);
35 Tv = u + beta*EXPECT(v(bp));
36 c + bp/(1+r) == b + w*e*n - tau*taxed + D;
37 ne = n*e;
38 c >= 1e-8;
39 bp >= b_min;
40 n >= 0;
41end;
42
43var_agg Y pii w S PA PB;
44mu = 1.2; % markup
45theta = 0.15; % prob staggered price
46pop_taxed = 0.25;
47ii0 = 0.005;
48G = 0;
49phi = 1.5;
50z = 1.0; % labor productivity
51
52% bond level affects steady state interest rate
53% see how it is calibrated in model_cali
54B = 5.6;
55
56% initial
57N = 1;
58
59var_agg_shock beta m_shock;
60m_shock = 0.0;
61
62model;
63 N = Y*S / z;
64 D = Y-w*N;
65 ii = max(ii0 + phi*pii + m_shock,0);
66 r = (1+ii) / (1+pii(+1)) - 1;
67 tau = (B+G-B/(1+r)) / pop_taxed;
68 pstar = PA/PB;
69
70 S == theta*pstar^(mu/(1-mu)) + (1/(1+pii))^(mu/(1-mu))*(1-theta)*S(-1);
71 1+pii == ( (1-theta)/(1-theta*(pstar)^(1/(1-mu))) )^(1-mu);
72 PA == mu*w/z*Y + (1-theta)*beta*(1+pii(+1))^(-mu/(1-mu))*PA(+1);
73 PB == Y + (1-theta)*beta*(1+pii(+1))^(-1/(1-mu))*PB(+1);
74 N == ne;
75 B == bp;
76end;
77
78% a different block for calibration; arguments to overwrite aggregate unknowns (var_agg)
79model_cali(N, B);
80 Y = z*N;
81 w = z/mu;
82 D = Y - w*N;
83 r = ii0;
84 tau = (B+G-B/(1+r)) / pop_taxed;
85
86 N == ne;
87 B == bp;
88
89 PA = mu*w/z*Y / (1-(1-theta)*beta);
90 PB = Y / (1-(1-theta)*beta);
91 S = 1;
92 pii = 0;
93end;
The equilibrium system now involves non-trivial market clearing conditions but nevertheless can be represented by a system of equations. Define the time sequence of all unknowns in var_agg and the same number of equations in the model block with “==” (see codes highlighted below):
43var_agg Y pii w S PA PB;
44mu = 1.2; % markup
45theta = 0.15; % prob staggered price
46pop_taxed = 0.25;
47ii0 = 0.005;
48G = 0;
49phi = 1.5;
50z = 1.0; % labor productivity
51
52% bond level affects steady state interest rate
53% see how it is calibrated in model_cali
54B = 5.6;
55
56% initial
57N = 1;
58
59var_agg_shock beta m_shock;
60m_shock = 0.0;
61
62model;
63 N = Y*S / z;
64 D = Y-w*N;
65 ii = max(ii0 + phi*pii + m_shock,0);
66 r = (1+ii) / (1+pii(+1)) - 1;
67 tau = (B+G-B/(1+r)) / pop_taxed;
68 pstar = PA/PB;
69
70 S == theta*pstar^(mu/(1-mu)) + (1/(1+pii))^(mu/(1-mu))*(1-theta)*S(-1);
71 1+pii == ( (1-theta)/(1-theta*(pstar)^(1/(1-mu))) )^(1-mu);
72 PA == mu*w/z*Y + (1-theta)*beta*(1+pii(+1))^(-mu/(1-mu))*PA(+1);
73 PB == Y + (1-theta)*beta*(1+pii(+1))^(-1/(1-mu))*PB(+1);
74 N == ne;
75 B == bp;
76end;
One can define an alternative model block that is different from the main model block. For example, the following block in the script file defines a block for calibration, which takes different unknowns and a different system of equations. Here, the calibration is at the steady state, so we can reduce the calibration system into an equation for aggregate labor and bond holding, with all other variables being simple functions with the two unknowns, or implied by the steady state condition.
79model_cali(N, B);
80 Y = z*N;
81 w = z/mu;
82 D = Y - w*N;
83 r = ii0;
84 tau = (B+G-B/(1+r)) / pop_taxed;
85
86 N == ne;
87 B == bp;
88
89 PA = mu*w/z*Y / (1-(1-theta)*beta);
90 PB = Y / (1-(1-theta)*beta);
91 S = 1;
92 pii = 0;
93end;
All var_agg need to be initialized right after declaration, unless their values are returned from an alternative model block (e.g., here, by the model_cali block). See below for how to pass the calibration solution to solving the main model block.
Use the Toolbox
After parsing the script file, the toolbox generates MATLAB files: solve_vfi.m, solve_ss.m, solve_trans_linear.m, solve_trans_nonlinear.m, solve_cali.m and other functions that can be called to solve the steady state, stationary distribution, transition paths, and alternative system (here, calibration) of the model. The usages of the generated files are illustrated below.