This repository accompanies my master thesis, titled Financial Constraints and Household Heterogeneity in the Macroeconomy and supervised by Prof. Dr. Keith Kuester and Dr. Gregor Böhl. This thesis was presented to the Department of Economics at the Rheinische Friedrich-Wilhelms-Universität Bonn in partial fulfillment of the requirements for the degree of Master of Science (M.Sc.) in Economics. In particular, you can find in this repository the thesis itself and the codes to generate the results as well as the figures found therein.
This is the main file of the project. The code herein produces the core results of my thesis. Some of the results are used by other code files, such as compare_transitions.py
. The code here allows the user to select one or more of the possible combinations of models and shocks. Having set the respective choices, the code loads, adjusts and solves the initial and terminal models, computes the fully non-linear perfect-foresight transition paths and prints various informative plots and tables about the steady states and the transitions. If desired, these results are stored in the folder Results. The transitions can also be stored as pickle files in the end, for easy re-use by compare_transitions.py
.
This file contains code which visually compares the transitions produced by different models and shocks. In particular, the user selects the combination of instances to be compared. To compare transitions, these must have been implemented and stored first via the main.py file
.
This file implements the permanent shock to the household discount factor in the baseline model, as described in appendix E.3 of the thesis.
This file calculates targets for the calibration of the models in the thesis and plots some of the time series.
This file contains custom functions used throughout the project.
This file contains custom functions for plotting various results throughout the project.
The folder Models contains the models employed by the various code files:
hank_baseline.yml
: baseline modelhank_slow_shock.yml
: model with high persistence in shock processeshank_fast_shock.yml
: model with low persistence in shock processeshank_end_L.yml
: extended model with CRRA preferences and endogenous labour supplyhank_very_slow_phi.yml
: model with very high persistence in borrowing limithank_no_ZLB.yml
: model without zero-lower boundhank_low_B.yml
: model with low calibration of liquid assetshank_baseline_beta.yml
: baseline model with shock to household discount factor
All of these are to the largest part based on the models from the Econpizza
package, which is also used for the model solution. Finally, the Models folder also contains hank_functions.py
, which contains functions necessary for the solution of the models and similarly derives almost entirely from an example file in Econpizza
.
The folder Results contains the results produced by the main.py
file and the custom_functions.py
file. The figures and tables are in various subfolders, whose names are meant be indicative for their respective contents. However, it might be much more useful to run the simulations through the files main.py
and custom_functions.py
to obtain the specific results one desires.
The folder Data contains a CSV file with data on US household balance sheets, obtained from the Federal Reserve website on the Flow of Funds and used by calibration.py
.
The folder Thesis contains the TeX code of the thesis, its .bib
file and its PDF version.
All these codes were run using the Spyder IDE 5.4.3 with Python 3.9.12 and Econpizza
0.6.1 on macOS 12.6.5.