Skip to content

← Return to Homepage

Data and Code

Matlab Library

My Matlab library contains common functions used by my other programs. Before using these programs, first download the library and add the library files (including those in subdirectories) to your Matlab path.

Data for China’s Macroeconomy

↑ Back to Top

Computer Code

  • The MATLAB code for reproducing the monetary policy shocks and systematic component estimated from the interest rate rule in the paper “A Trade-off Between Monetary Policy Transmission and Systemic Risk” is available in this Dropbox folder for viewing and downloading. For instructions, see the ReadMe.md file in that folder.
  • The MATLAB code for reproducing the 6-variables core proxy SVAR results in the paper “Algorithm-Driven SVARs: Navigating the Wilderness of Big Data” is available in this Dropbox folder for viewing and downloading. For instructions, see the Readme_Proxy.txt file in that folder.
  • The MATLAB code for reproducing the empirical results in the paper “Sharpening Economic Interpretation with HARS” is available in this Dropbox folder for viewing and downloading. For instructions, see the README.pdf file in the folder.
  • The Matlab code ChinaMPCode.zip generates China monetary policy shocks from the estimated interest rate rule in the paper “A Trade-off Between Monetary Policy Transmission and Systemic Risk.” For instructions, see ReadMe.md included in the zip file.
  • The Matlab code PublicCodeJIMF.zip replicates the results in our 2024 JIMF article “Constructing Quarterly Chinese Time Series Usable for Macroeconomic Analysis.” It computes the posterior mode of the model parameters and posterior probability bands for impulse responses in SVAR models with Gaussian shock heteroskedasticity, using the Sims and Zha prior (IER, 1998). For instructions, see readme_public.txt included in the zip file.
  • Matlab code and documentation for “The Nexus of Monetary Policy and Shadow Banking in China” (AER, 2018):
    1. Panel SVAR estimation routines are available in AER_CodePanelSVAR.zip.
    2. Code for estimating the time-varying monetary policy rule and exogenous shocks is provided in UpdateMPshocks.zip.
    3. Time series of estimated exogenous monetary policy shocks are available in CSV format (MPshocksPublic.zip).
  • The Matlab file SRestrictRWZalg.m.zip implements the RWZ algorithm for imposing sign restrictions on impulse responses. An empirical example, RWZrestrictions_FiscalPolicy.zip, illustrates its application to identifying fiscal policy shocks. This efficient algorithm is developed and described in detail in “Structural Vector Autoregressions: Theory of Identification and Algorithms for Inference” (REStud, 2010).
  • The Matlab code in RestrictedVAR.zip implements structural VARs with linear over-identified restrictions on both current and lagged coefficients with or without the Sims and Zha prior (IER, 1998), as discussed in Cushman and Zha (JME, 1997), Zha (JE, 1999), and Waggoner and Zha (JEDC, 2003). The example, motivated by Dhawan and Jeske’s DSGE model, uses four variables—energy prices, durable investment, capital investment, and output—assuming energy prices follow an exogenous autoregressive process. The code performs three key tasks:
    (1) estimation of model parameters and impulse responses with or without standard Bayesian priors;
    (2) computation of error bands for impulse responses; and
    (3) calculation of the marginal likelihood (data density).
    See readme_mdd.txt inside the zip file for detailed explanations and instructions.
  • The Matlab code Cfprob.zip generates the probability distributions of conditional forecasts, based on the methodology developed in “Conditional Forecasts in Dynamic Multivariate Models” (REStat, 1999).

    Python code for Econ 112

    Download the zip file (PythonEcon112.zip) containing all data, code, and instructions (README.txt). At minimum, you will need to:

    • Obtain a FRED API key
    • Install Python
    • Install Visual Studio Code (VSC)

    The zip file also includes a monthly real GDP series that we constructed and will update periodically.

↑ Back to Top