THE GLOBAL DOLLAR CYCLE
Maurice Obstfeld and Haonan Zhou
Prepared for BPEA Fall 2022 issue

Replication Kit: README

#######################################################################################################
#######################################################################################################

1. Contact
Contact Haonan Zhou at haonan@princeton.edu for questions on the code and data. 

#######################################################################################################

2. Proprietary / Commercial data sources
This work heavily sources data from commercial data vendors / aggregators, including
CEIC, Bloomberg and Refinitiv. As a result, we are not able to share all of our datasets 
for replication purposes. However, we make sure to document in the data appendix 
for readers to reconstruct our data. We also provide empty datasets in our replication 
folder with the variables and variable labels that we use (See point 4). Users can always contact us 
for pointers on the exact data tickers we use. 

In particular, data/fx_reg/dollar_reg_data is made empty. 

The local projection datasets can be generated using national sources alone, 
except in a few cases (export, import prices, long-term interest rates (not used in our exercise), 
and equity price index, see Online Appendix for details). 
We make sure to include as much data as we could in the public folder. 

#######################################################################################################

3. Environment
This work uses a number of statistical software / programming languages. The results have 
been tested using STATA 16, Python 3.8.13 and MATLAB 2022a where applicable. Make sure to 
install Jupyter Notebook (from Anaconda) to run the .ipynb notebook files. 

For STATA codes running reghdfe, we require version 5.x (downloadable from SSC). Some local 
projection exercises ran into issues when using the development 6.x version downloaded from 
Sergio Correia's website. 

If the user would like to run GDP dynamic factor models (see code/misc/output_factor), he/she 
needs to install IRIS toolbox for data processing. 
(latest version: https://github.com/IRIS-Solutions-Team/IRIS-Toolbox/releases/tag/Release-20220918)

#######################################################################################################

4. Folder structure

code: folder containing all computer codes to replicate the results in the published paper. 
    lp:     Section 2 local projection results. The file names are self-explanatory.
            Run lp_master.do to generate all figures, including the full set of IRFs in the appendix. 
    fx_reg: Section 3 exchange rate regression results. 
            dollar_reg_st: regressions involving short-term rates. (Table 2)
            dollar_reg_lt: regressions involving long-term rates. (Table 3-4)
    misc:   Miscellaneous figures in the paper. File names in parentheses.
            desc: generates Figure 1 (EWN), 2 (BOP), 3-7 and 15 (GDC), 12-13 (dollar_desc). 
            output_factor: extract real GDP common factors using a dynamic factor model. 
            termpremium: extract term premia from G-10 countries. 
            var: supplemental VAR exercise reported in Appendix A.2. 

The data folder has a similar structure compared to code. 
    The folder desc includes the underlying data that generates Figure 3-7 and 15 in the paper. 
    fx_reg/dollar_reg_data: data file for the exchange rate regressions. Since we heavily source from 
                            commercial data vendors, we replace all variables to missing values. 
    lp/lp_data:             data file for the local projections. We replace the following variables to 
                            missing values: pexp, pimp, ltrates, equity, rlt as they are largely sourced 
                            from commercial vendors. 

output: figures and tables for the paper. 

#######################################################################################################

5. Output: name correspondence to tables. 

Most of the output mappings should be clear from the file names. 

    Figure 8:  lp/dollar_pub.pdf.
    Figure 9:  lp/dollar_pub_fxregime.pdf
    Figure 10: lp/dollar_pub_monetary.pdf
    Figure 11: lp/dollar_pub_currency.pdf
    Figure 14: lp/ebp_pub.pdf

    Figure A1: lp/dollar_na.pdf, dollar_price.pdf, dollar_int.pdf
    Figure A2: lp/dollar_na_fxregime.pdf, dollar_price_fxregime.pdf, dollar_int_fxregime.pdf
    Figure A3: lp/dollar_na_monetary.pdf, dollar_price_monetary.pdf, dollar_int_monetary.pdf
    Figure A4: lp/dollar_na_currency.pdf, dollar_price_currency.pdf, dollar_int_currency.pdf
    Figure A5: misc/irf_EBP_iborbasis.eps
    Figure A6: lp/ebp_na.pdf, ebp_price.pdf, ebp_int.pdf
    

#######################################################################################################