Cao and Nie (2017): Amplification and Asymmetry without Collateral Constraint
Cao and Nie (2017) studies a two-agent model with a borrowing constraint tied to the price of an asset with fixed supply. It is well known that the existence of a collateral constraint amplifies aggregate productivity shocks when the shock pushes the constraint to bind. They show that the incomplete-markets structure of the model by itself can deliver amplified and asymmetric responses of the model to symmetric productivity shocks, even without a collateral constraint.
The model is an example to show that getting the initial starting point for policy iterations and the solution to the boundary of the state space right is crucial in solving the model. These features can be implemented very conveniently with the toolbox.
Please see the paper for the details of the model.
The gmod File
1% Parameters
2parameters H beta2 beta1 sigma1 sigma2 sigmah eta m phi nu ABad AGood;
3H = 1;
4beta1 = 0.98;
5beta2 = 0.99;
6sigma1 = 1;
7sigma2 = 1;
8sigmah = 1;
9eta = 1;
10m = 0.89;
11phi = 0.057143;
12nu = 0.041224;
13
14PrintFreq = 100;
15SaveFreq = 100;
16
17% States
18var_state X;
19XPts = 701;
20XMin=0.0;
21XMax=1;
22X=linspace(XMin,XMax,XPts);
23
24% Shocks
25shock_num=3;
26
27var_shock A;
28ABad = 0.97;
29AGood = 1.03;
30A = [ABad 1 AGood];
31
32% From Equation (17)
33shock_trans = [
34 0.7204 1-0.7204 0.0
35 (1-0.872)/2 0.872 (1-0.872)/2
36 0.0 1-0.7204 0.7204
37 ];
38
39% Tensor variables
40var_tensor;
41
42% Variable for the last period
43var_policy_init h L;
44inbound_init h 1e-20 H;
45inbound_init L 1e-20 2;
46
47var_aux_init c cp q;
48model_init;
49 Y = A*h^nu * L^(1-nu);
50 q = nu*A*h^(nu-1)*L^(1-nu);
51 w = (1-nu)*A*h^nu*L^(-nu);
52
53 c = q*H*X;
54 cp = Y-q*H*X;
55 hp = H-h;
56
57 foc_hp = -1 + phi*hp^(-sigmah)/(q*cp^(-sigma2));
58 foc_L = -1 + w*cp^(-sigma2)/(L^(eta-1));
59
60 equations;
61 foc_hp;
62 foc_L;
63 end;
64end;
65
66% Endogenous variables, bounds, and initial values
67var_policy p q c h a cp L mu Xp[3];
68inbound p 0 2 adaptive(1.5);
69inbound q 0 2 adaptive(1.5);
70inbound c 0.0 2 adaptive(1.5);
71inbound h 1e-20 1;
72inbound a 1e-20 2 adaptive(1.5);
73inbound L 1e-20 2 adaptive(1.5);
74inbound mu 0.0 1;
75inbound cp 0.0 2 adaptive(1.5);
76inbound Xp 0.0 1.2;
77
78var_aux Y YTilde b bp hp;
79
80var_interp cFuture cpFuture qFuture;
81cFuture = c;
82cpFuture = cp;
83qFuture = q;
84% Initialize using model_init
85initial cFuture c;
86initial cpFuture cp;
87initial qFuture q;
88
89%
90var_output Xp Y YTilde p q;
91
92model(X>0);
93 Y = A*h^nu * L^(1-nu);
94 % eq9
95 w = (1-nu)*A * h^nu * L^(-nu);
96 profit = (Y-w*L)/h;
97
98 [cNext',cpNext',qp'] = GDSGE_INTERP_VEC'(Xp');
99
100 Eqp = GDSGE_EXPECT{qp'};
101
102 % Transform of variable
103 b = a - m*Eqp*h;
104
105 % Implied by market clear
106 bp = -b;
107 hp = H-h;
108
109 % Implied by budget constraint
110 budget1 = c-(q*X*H + Y-w*L - q*h - p*b);
111 budget2 = cp-(q*(1-X)*H + w*L - q*hp - p*bp);
112
113 YTilde = Y + phi*hp^(-sigmah)/(cp^(-sigma2)) * hp;
114
115 % Equations in text
116 eq10 = -1 + mu*m*Eqp*p/(q-profit) + beta1*GDSGE_EXPECT{qp'*cNext'^(-sigma1)} / ((q-profit)*c^(-sigma1));
117 eq11 = mu*a;
118 eq12 = -1 + mu + beta1 * GDSGE_EXPECT{ cNext'^(-sigma1) } / (p*c^(-sigma1));
119 eq13 = -1 + phi*hp^(-sigmah) / (q*cp^(-sigma2)) + beta2*GDSGE_EXPECT{ qp'*cpNext'^(-sigma2) } / (q*cp^(-sigma2));
120 eq14 = -1 + beta2 * GDSGE_EXPECT{ cpNext'^(-sigma2) } / (p*cp^(-sigma2));
121 eq15 = -1 + L^(eta-1) / (w*cp^(-sigma2));
122
123 % Consistency
124 consis1 = (qp(1)*h+b) / (qp(1)*H) / Xp(1) - 1;
125 consis2 = (qp(2)*h+b) / (qp(2)*H) / Xp(2) - 1;
126 consis3 = (qp(3)*h+b) / (qp(3)*H) / Xp(3) - 1;
127
128 equations;
129 % budget
130 budget1;
131 budget2;
132
133 % Optimality condition
134 eq10;
135 eq11;
136 eq12;
137 eq13;
138 eq14;
139 eq15;
140
141 % Consistency
142 if A==AGood
143 Xp(1);
144 else
145 consis1;
146 end
147
148 consis2;
149
150 if A==ABad
151 Xp(3);
152 else
153 consis3;
154 end
155 end;
156end;
157
158model(X==0);
159 Y = A*h^nu * L^(1-nu);
160 w = (1-nu)*A * h^nu * L^(-nu);
161 profit = (Y-w*L)/h;
162
163 [cNext',cpNext',qp'] = GDSGE_INTERP_VEC'(Xp');
164
165 Eqp = GDSGE_EXPECT{qp'};
166
167 % Transform of variable
168 b = a - m*Eqp*h;
169
170 % Implied by market clear
171 bp = -b;
172 hp = H-h;
173
174 % Implied by budget constraint
175 budget2 = cp-(q*(1-X)*H + w*L - q*hp - p*bp);
176
177 YTilde = Y + phi*hp^(-sigmah)/(cp^(-sigma2)) * hp;
178
179 % Equations in Guangyu's new note
180 eq7 = -1 + phi*hp^(-sigmah) / (q*cp^(-sigma2)) + beta2 * GDSGE_EXPECT{ qp'*cpNext'^(-sigma2) } / (q*cp^(-sigma2));
181 eq8 = -1 + beta2 * GDSGE_EXPECT{ cpNext'^(-sigma2) } / (p*cp^(-sigma2));
182 eq9 = -1 + L^(eta-1) / (w*cp^(-sigma2));
183 eq11 = -1 + (q - profit)/(m*Eqp*p);
184
185 % Consistency
186 consis1 = (qp(1)*h+b) / (qp(1)*H) / Xp(1) - 1;
187 consis2 = (qp(2)*h+b) / (qp(2)*H) / Xp(2) - 1;
188 consis3 = (qp(3)*h+b) / (qp(3)*H) / Xp(3) - 1;
189
190 equations;
191 % budget constraint
192 eq11; % This is equivalent to enterpreneur's budget when c and X = 0
193 budget2;
194
195 % Optimality condition
196 c-0;
197 mu-0; % I have set mu=0, though mu is not known ex-ante.
198 a-0;
199 eq7;
200 eq8;
201 eq9;
202
203 % Consistency
204 if A==AGood
205 Xp(1);
206 else
207 consis1;
208 end
209
210 consis2;
211
212 if A==ABad
213 Xp(3);
214 else
215 consis3;
216 end
217 end;
218end;
219
220simulate;
221 num_periods = 10000;
222 num_samples = 100;
223 initial X 0.5
224 initial shock 1;
225 var_simu Y YTilde;
226 X' = Xp';
227end;