JM
  • Home
  • Projects
  • Resume

Macroeconomic Forecasting and Machine Learning: Paper Replication

Research Assistant, Johns Hopkins University — Dr. Domenico Giannone’s Lab

This project replicates a machine-learning framework for probabilistic macroeconomic forecasting, focusing on one-month-ahead changes in the U.S. unemployment rate. Using the FRED-MD dataset, I compare linear and deep neural network models within a recursive quantile forecasting framework to study how model complexity affects forecast performance.

I implemented the replication independently in Python and PyTorch, covering the full pipeline from macroeconomic data construction and recursive estimation through hyperparameter selection and out-of-sample evaluation. The project replicates the methodology of Macroeconomic Forecasting and Machine Learning by Domenico Giannone and coauthors.

Data and Forecasting Design

The project uses the monthly FRED-MD macroeconomic database, containing more than 100 indicators covering output, employment, prices, interest rates, financial markets, and other areas of the U.S. economy. I implemented the dataset construction pipeline using the FRED-MD transformation codes and constructed the forecasting target as the one-month change in the unemployment rate.

Forecasts are generated recursively using an expanding window. At each forecast origin, predictors and the target are standardized using only the historical observations available at that point. This prevents future information from entering either model estimation or preprocessing.

Models

I implemented three forecasting approaches of increasing complexity:

  • Historical quantile benchmark: estimates the forecast directly from the historical distribution of unemployment changes.
  • Linear quantile regression: allows the macroeconomic predictors to affect different parts of the conditional unemployment distribution.
  • Deep neural network quantile regression: uses PyTorch to model nonlinear relationships between the macroeconomic predictors and future unemployment changes.

Deep neural network density forecasts of monthly changes in the U.S. unemployment rate, showing the median forecast, 50% and 90% prediction intervals, actual unemployment changes, NBER recessions, and the test period.

Deep neural network quantile forecasts of monthly changes in the U.S. unemployment rate. Shaded regions show the 50% and 90% prediction intervals; the orange line shows realized unemployment changes and gray regions indicate NBER recessions.

All models produce quantile forecasts rather than only point predictions. This allows the forecasts to describe the distribution of possible outcomes and construct predictive intervals around future unemployment changes.

Model Selection and Evaluation

For the neural network models, I implemented a validation search across network architecture and regularization choices. Candidate models vary in network depth, hidden-layer width, activation parameters, and regularization, with model complexity selected using validation performance before final out-of-sample evaluation.

Forecast accuracy is evaluated using quantile (pinball) loss, which penalizes forecasts differently depending on whether an observation falls above or below the predicted quantile. I also reproduce the paper’s predictive-interval visualization and compare forecast performance across model complexity.

Skills used

Python · PyTorch · Time-series forecasting · Quantile regression · Deep Learning · Model selection

Reference

Giannone, D., Lenza, M., Primiceri, G., and coauthors. Macroeconomic Forecasting and Machine Learning.