# How to compute the economic impact of sector-specific shocks?

(using **Sectoral Effects of Social Distancing** joint with Jean-Noël Barrot and Julien Sauvagnat)

How to compute the economic impact of sector-specific productivity, labor supply, and/or capital supply shocks? In **Sectoral Effects of Social Distancing**, we evaluate the effect of social distancing through lens of a standard input-output model where social distancing is considered as sector-specific labor supply shocks.

We believe that the model and the code built for this exercise can be used to study the effect of various sector-specific shocks on sector and aggregate level variables in different geographical areas. This page described how to use the model and the code to look at productivity, labor supply, and/or capital supply shocks. Everything is written in Matlab and quite plug&play and can be download **here**.

**Citation suggestion:**

Barrot, Jean-Noël, Basile Grassi, and Julien Sauvagnat. 2021. "Sectoral Effects of Social Distancing." AEA Papers and Proceedings,111: 277-81. DOI: 10.1257/pandp.20211108

## The model

In this framework, there is a representative household who consumes a bundle of N goods, and supplies inelastically sector-specific labor, l_i, and capital, k_i. In each sector, there is a representative firm which produces the sector good using sector-specific labor and capital together with other goods used as intermediate inputs. There is no nominal friction, and prices are equal to marginal costs. All markets clear.

Here we use the "exact hat-algebra", where a "hat" over a variables means deviation from the initial, before the shocks, equilibrium.

### Preferences:

### Technology:

### Summary:

## The Code and How to Use it

The code solve the above model for an user-supplied (labor supply and/or demand) sector-specific shocks. First, it "calibrate" the model by computing the parameters in the above table. Second, it solves for the change from the initial equilibrium of all variables after the sector-specific shocks. Finally, it put all results in a excel file.

### Code structure

The main file to run in Matlab (R2020a) is main_BEA504.m, which does everything. It first call the calibrate_BEA504_hat_fun.m that use the input-output tables in the folder data_deep. Second, it call the matlab function exercice_hat_fun_nicefigure.m which load the sector-specific shocks, solve the model, produce the results. For more detailed information, you can read the readme file.

### How to:

*If you want to add a labor supply shocks scenario:*

Just copy-paste in the next column available in data_deep/Data_US_BEA405_DEC2020_laborsupply.xlsx the list of labor shocks. Note that these labor shocks need to be given in the same order of the BEA classification given in the first column of this file. Give a name to the first line of the column [name_shock].

Then run in matlab the file main_BEA504.m or just the line which contains exercice_hat_fun_nicefigure(...). In the folder export you should find an excel file whose name contains [name_shock], the name of the column of your labor_suply shock.

*If you want to add a demand shocks scenario:*

Just copy-paste in the next column available in data_deep/Data_US_BEA405_DEC2020_demand.xlsx the list of demand shocks. Note that these demand shocks need to be given in the same order of the BEA classification given in the first column of this file. Give a name to the first line of the column [name_shock]

Then run in matlab the file main_BEA504.m or just the line which contains exercice_hat_fun_nicefigure(...). In the folder export you should find an excel file whose name contains [name_shock], the name of the column of your demand shock.

*If you want to use a different Input-Output matrix:*

Modify the IMPORT DATA section of lib/calibrate_BEA504_hat_fun.m to replace the data used here. The comments and variable names should be self-explanatory.