-
Notifications
You must be signed in to change notification settings - Fork 377
/
Copy pathrun_all_files.m
397 lines (357 loc) · 10.2 KB
/
run_all_files.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
clearvars all; clearvars -global;
%% Aguiar_Gopinath_2007
try
close all;
cd('Aguiar_Gopinath_2007');
dynare Aguiar_Gopinath_2007
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% Andreasen_2012
try
close all; clearvars all; clearvars -global;
cd('../Andreasen_2012');
dynare Andreasen_2012_rare_disasters
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% Ascari_Sbordone_2014
try
close all; clearvars all; clearvars -global;
cd('../Ascari_Sbordone_2014');
dynare Ascari_Sbordone_2014
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% Basu_Bundick_2017
try
close all; clearvars all; clearvars -global;
cd('../Basu_Bundick_2017');
dynare Basu_Bundick_2017
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% Born_Pfeifer_2014
try
close all; clearvars all; clearvars -global;
cd('../Born_Pfeifer_2014');
dynare Born_Pfeifer_RM_Comment.mod
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% Born_Pfeifer_2018
try
close all; clearvars all; clearvars -global;
cd('../Born_Pfeifer_2018/Monetary_Policy_IRFs');
run_IRF_comparison;
cd('../Welfare');
run_welfare_comparison_efficient_steady_state;
run_welfare_comparison_inefficient_steady_state;
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% Born_Pfeifer_2020
try
close all; clearvars all; clearvars -global;
cd('../../Born_Pfeifer_2020');
run_model_IRF_generation;
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% Caldara_et_al_2012
try
close all; clearvars all; clearvars -global;
cd('../Caldara_et_al_2012');
dynare Caldara_et_al_2012
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% Chari_et_al_2007
try
close all; clearvars all; clearvars -global;
cd('../Chari_et_al_2007');
dynare Chari_et_al_2007
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% Collard_2001
try
close all; clearvars all; clearvars -global;
cd('../Collard_2001');
get_shock_standard_deviation;
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% FV_et_al_2007
try
close all; clearvars all; clearvars -global;
cd('../FV_et_al_2007');
dynare FV_et_al_2007_ABCD
dynare FV_et_al_2007_ABCD_minreal
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% Gali_2008
try
close all; clearvars all; clearvars -global;
cd('../Gali_2008');
dynare Gali_2008_chapter_2
dynare Gali_2008_chapter_3
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% Gali_2010
try
close all; clearvars all; clearvars -global;
cd('../Gali_2010');
dynare Gali_2010
dynare Gali_2010_calib_target
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% Gali_2015
try
close all; clearvars all; clearvars -global;
cd('../Gali_2015');
dynare Gali_2015_chapter_2
dynare Gali_2015_chapter_3
dynare Gali_2015_chapter_4
dynare Gali_2015_chapter_5_discretion
dynare Gali_2015_chapter_5_commitment
dynare Gali_2015_chapter_5_discretion_ZLB
dynare Gali_2015_chapter_5_commitment_ZLB
dynare Gali_2015_chapter_6
dynare Gali_2015_chapter_6_4
dynare Gali_2015_chapter_6_5
dynare Gali_2015_chapter_7
dynare Gali_2015_chapter_8
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% Gali_Monacelli_2005
try
close all; clearvars all; clearvars -global;
cd('../Gali_Monacelli_2005');
dynare Gali_Monacelli_2005
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% GarciaCicco_et_al_2010
try
close all; clearvars all; clearvars -global;
cd('../GarciaCicco_et_al_2010');
dynare GarciaCicco_et_al_2010
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% Ghironi_Melitz_2005
try
close all; clearvars all; clearvars -global;
cd('../Ghironi_Melitz_2005');
dynare Ghironi_Melitz_2005.mod
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% Guerrieri_Iacoviello_2015
try
close all; clearvars all; clearvars -global;
cd('../Guerrieri_Iacoviello_2015');
dyn_ver = dynare_version;
if str2double(dyn_ver(1)) >= 5
dynare Guerrieri_Iacoviello_2015_rbc
dynare Guerrieri_Iacoviello_2015_nk
end
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% HP_filter_missing_data
try
close all; clearvars all; clearvars -global;
cd('../HP_filter_missing_data');
dyn_ver = dynare_version;
if str2double(dyn_ver(1)) >= 5
dynare HP_filter_missing_data.mod
end
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% Hansen_1985
try
close all; clearvars all; clearvars -global;
cd('../Hansen_1985');
dynare Hansen_1985.mod
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% Ireland_2004
try
close all; clearvars all; clearvars -global;
cd('../Ireland_2004');
dynare Ireland_2004
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% Jermann_1998
try
close all; clearvars all; clearvars -global;
cd('../Jermann_1998');
dynare Jermann_1998
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% Jermann_Quadrini_2012
try
close all; clearvars all; clearvars -global;
cd('../Jermann_Quadrini_2012/Jermann_Quadrini_2012_RBC');
construct_data
dynare Jermann_Quadrini_2012_RBC
cd('../Jermann_Quadrini_2012_NK');
dynare Jermann_Quadrini_2012_NK
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% McCandless_2008
try
close all; clearvars all; clearvars -global;
cd('../../McCandless_2008');
dynare McCandless_2008_Chapter_9
dynare McCandless_2008_Chapter_13
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% NK_linear_forward_guidance
try
close all; clearvars all; clearvars -global;
cd('../NK_linear_forward_guidance');
dynare NK_linear_forward_guidance
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% RBC_IRF_matching
try
close all; clearvars all; clearvars -global;
cd('../RBC_IRF_matching');
dynare RBC_IRF_matching
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% RBC_baseline
try
close all; clearvars all; clearvars -global;
cd('../RBC_baseline');
dynare RBC_baseline
dynare RBC_baseline_first_diff_bayesian
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% RBC_baseline_welfare
try
close all; clearvars all; clearvars -global;
cd('../RBC_baseline_welfare');
dynare RBC_baseline_welfare
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% RBC_capitalstock_shock
try
close all; clearvars all; clearvars -global;
cd('../RBC_capitalstock_shock');
dynare RBC_capitalstock_shock.mod
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% RBC_news_shock_model
try
close all; clearvars all; clearvars -global;
cd('../RBC_news_shock_model');
dynare RBC_news_shock_model
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% RBC_state_dependent_GIRF
try
close all; clearvars all; clearvars -global;
cd('../RBC_state_dependent_GIRF');
dynare RBC_state_dependent_GIRF
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% SGU_2003
try
close all; clearvars all; clearvars -global;
cd('../SGU_2003');
dynare SGU_2003.mod
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% SGU_2004
try
close all; clearvars all; clearvars -global;
cd('../SGU_2004');
dynare SGU_2004
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% Sims_2012
try
close all; clearvars all; clearvars -global;
cd('../Sims_2012');
addpath('../FV_et_al_2007'); %ABCD_test.m
dynare Sims_2012_RBC
rmpath('../FV_et_al_2007');
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% Smets_Wouters_2007
try
close all; clearvars all; clearvars -global;
cd('../Smets_Wouters_2007');
dynare Smets_Wouters_2007
dynare Smets_Wouters_2007_45
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% Solow_model
try
close all; clearvars all; clearvars -global;
cd('../Solow_model');
dynare Solow_SS_transition
dynare Solow_growth_rate_changes -DTFP_growth=false
dynare Solow_growth_rate_changes -DTFP_growth=true
dynare Solow_nonstationary
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% Stock_SIR_2020
try
close all; clearvars all; clearvars -global;
cd('../Stock_SIR_2020');
dynare Stock_SIR_2020
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% Woodford_2003
try
close all; clearvars all; clearvars -global;
cd('../Woodford_2003');
dynare Woodford_2003_Chapter_7
catch ME
fid = fopen('error.txt', 'w'); fprintf(fid,'%s',ME.message);fclose(fid);
end
%% Evaluate errors
cd('..')
% Get list of all subfolders.
files = dir(fullfile(pwd, '**', 'error.txt'));
% If the file is found, print the folder and error
if ~isempty(files)
fprintf('\n\n\nFOUND ERRORS:\n***********\n')
for i = 1 : length(files)
fprintf('Found error in folder: %s', fullfile(files(i).folder));
type(fullfile(files(i).folder, files(i).name));
fprintf('***********\n')
delete(fullfile(files(i).folder, files(i).name));
end
error('There were errors!')
else
fprintf('NO ERRORS FOUND!\n');
end