This repository contains the code and data accompanying the paper "Has the Recession Started?", written by Pascal Michaillat and Emmanuel Saez, and posted on arXiv in September 2024.
The paper is available at https://pascalmichaillat.org/16/.
The raw data used to produce the results in the paper are stored as CSV files. The data are placed in the folder raw
.
20210719_cycle_dates_pasted.csv
– US recession dates, 1929–2022CLF16OV.csv
– US labor-force level, 1948–2024CompositeHWI.xlsx - Sheet1.csv
– US vacancy rate, 1951–2020- Source: Barnichon (2010)
HistoricalSeries_JME_2020January.csv
– US unemployment and vacancy rates, 1890–2017- Source: Petrosky-Nadeau, Zhang (2021)
JTSJOL.csv
– US Job openings, 2001–2024UNEMPLOY.csv
– US unemployment level, 1948–2024
The results in the paper are produced with MATLAB code. The code is placed in the folder code
.
The main script, main.m
, orchestrates the production of the results in the paper. The script produces the 9 figures presented in the paper. The script generates each figure in a figure window and saves the figures as PDF files. The script also saves the data used to generate each figure in CSV files.
Before the computations begin, the main script calls two setup scripts:
setup.m
– Close figure windows, clear workspace and command window, set paths to folders with raw data and figuresformatFigure
– Format default figure, and predefine line and axis styles
The main script produces the individual figures using a collection of production scripts:
figure1.m
– Produce figure 1figure2A.m
– Produce figure 2Afigure2B.m
– Produce figure 2Bfigure34.m
– Produce figures 3 and 4figure5.m
– Produce figure 5figure6.m
– Produce figures 6A and 6Bfigure7.m
– Produce figure 7
Each script produces a figure in a figure window, saves a copy of the figure in PDF format, and saves the data used to generate each figure in CSV files.
The production scripts rely on a collection of helper functions:
getRecession.m
– Return US recession dates, 1929–2022getUnemployment.m
– Compute and return US unemployment rate, 1929–2024getVacancy.m
– Compute and return US vacancy rate, 1929–2024createIndicatorCountercyclical
– Apply the Sahm filter to a countercyclical variablecreateIndicatorProcyclical
– Apply the Sahm filter to a procyclical variable
The 9 figures produced by the code are saved as 9 PDF files. The data underlying each figure are saved in 9 CSV files. All the files are placed in the folder figures
, each corresponding to a specific figure in the paper:
figure1.pdf
,figure1.csv
– Figure 1figure2A.pdf
,figure2A.csv
– Figure 2Afigure2B.pdf
,figure2B.csv
– Figure 2Bfigure3.pdf
,figure34.csv
– Figure 3figure4.pdf
,figure34.csv
– Figure 4figure5.pdf
,figure5.csv
– Figure 5figure6A.pdf
,figure6.csv
– Figure 6Afigure6B.pdf
,figure6.csv
– Figure 6Bfigure7.pdf
,figure7.csv
– Figure 7
The results were obtained using MATLAB R2024a on an Apple Silicon Mac running macOS Sonoma 14.6.1.
The content of this repository is licensed under the terms of the MIT License.
- Python version of this code – Written by Jesse Stone