This readme.txt file was generated on 2023-15-02 by Ruben Hipp

-------------------
GENERAL INFORMATION
-------------------

Title: Data and Code Supporting “Estimating Large Dimensional Connectedness Tables: The Great Moderation Through the Lens of Sectoral Spillovers”
Title of Publication: “Estimating Large Dimensional Connectedness Tables: The Great Moderation Through the Lens of Sectoral Spillovers”

Description: The package contains data on industrial production and the code to replicate the results of the paper. The code runs a simulation study and an application for regularization techniques. The folders glmnet_matlab and Graphical Lasso are needed to run the adaptive elastic-net and the glasso, respectively.

Author Information 

1. Name: Felix Brunner
Institution: NOVA SBE
Email: brunner.felix@gmail.com

2. Name: Ruben Hipp
Institution: Bank of Canada (Financial Stability Department)
Email: rhipp@bankofcanada.ca
ORCID: https://orcid.org/0000-0003-2892-3280

-----------------------------
LIST OF FILES & FILE OVERVIEW
-----------------------------
Folder - glmnet_matlab : This is a Matlab port for the efficient procedures for fitting the entire lasso or elastic-net path for linear regression, logistic and multinomial regression, Poisson regression and the Cox model.
Folder - Graphical Lasso : This software estimates a sparse inverse covariance matrix using a lasso (L1) penalty. 
Folder - Graphs : All Output figures
Folder - VariationalGarrotte : This code implements the Variational Garrote algorithm [1] for sparse linear regression, a mean field variational approximation for the Spike and Slab model. The code can be called within the simulation files but is not used to produced output for the paper.
Folder - Functions : Subfunctions called by the main code. See list below
Folder - InputData :  Data used for the application. See list below 
Folder - Output : Output data saved from the main files

The files to replicate the paper are labelled with numbers as a prefix. All these files should be run on a cluster as they can take up to 3 days to finish.

1. Filename: A_OverheadSimulation.m
Format: m-file
brief description: The simulation overhead file calling functions MasterRegNeo.m (for regularizations of the coefficient) and MasterRegSig.m (for the regularization of the covariance matrix). It further uses subfunctions (see file list). Produces results for Table 1 and Table 2. Takes about 3-6 days on a cluster. 
One can also call the specific files for sub tables only, e.g., for data generating process 1 call 'MasterRegNeo(1)'. Outputs will be produced in a txt file called 'TableDGP~.txt' and stored in the Output folder.

2. Filename: B_MasterSimuAUROC.m
Format: m-file
brief description: The simulation for FEVD accuracy. Produces Figures 2 and 3. 

3. Filename: C_Application.m
Format: m-file
brief description: The full application. Produces Figures 4-7, and Tables 3-7. Also produces Figures D.9 to D.18. 
To run the code for a specific NAICS level, change 'NAIClevel' (line 17) to desired level. This is needed to produce numbers in Table 5.
For the dynamic versus static analysis, the code must be run separately for different specifications. In line 67, set 'BreakTests' to 'VAR-dynamic, 'Sigma-dynamic', 'all-static' or 'all-dynamic' and run the code. It will produce the AIC value in the command window.
The main application to produce all table and figures is with 'NAIClevel = 3' and 'BreakTests = 'all-dynamic''. The specification runs about 45 minutes on the cluster.

List of subfunctions (in Functions Folder) --  
                            
adaptiveElasticNet.m                   
adaptiveThresh.m
application_plots.m
application_staticA.m
application_staticSigma.m
AuxilaryGraphs.m                                    
covLedoit.m    
decompositionTable.m                                                     
DGP.m                                                                 
estimationA.m                                         
estimationBias.m                                  
estimationSig.m                                      
evaluate.m                                                
FEVD.m                                               
joyPlot.m
KfoldCV.m     
KfoldCVsigma.m       
latexTableAIC.m
latexTableEstimationOverview.m
makeConnectednessTable.m
makeLatexTable.m
networkPlot.m
OldPlots.m
parforloop.m
parforloopBias.m
parforloopSig.m
POET.m
regCV.m
RegularizeA.m
RegularizeAll.m
RegularizeApp.m
RegularizeSig.m
shrinkLedoit.m
shrinkLedoitmanual.m
Simulationplot.m
tpfpcurves.m
transformNames.m
VARols.m
  
Datafiles --
Format: csv, xlsx

IP98updated_formulas.xlsx : Main data. Sheet nomenclature: The suffix 'L'+number denotes the respective level of disaggregation of industrial production (IP) sectors. The suffix 'w' denotes that it corresponds to the weights for this file. 
IP98updated_formulas.xlsx : the master file which contains all the information (no inventories)
FOMC_Bauer_Swanson.xlsx: data pulled from Bauer and Swanson (2022) 
InvShipSICtoNAIC.xlsx: file matching the sectors from SIC to NAIC level. Including shipments and inventories for the level 3 disaggregation 
Shipments.xlsx
Inventories.xlsx

Output files --
Format: csv, txt, mat

ApplicationRun_mm_dd.mat : matlab file containing the estimation from dd/mm 
FEVD_H*_from**to**.csv : csv file with the estimated network for the respective period
TableXXXDGP*.txt : latex tables for the simulations of the coefficient (no XXX) or Sigma (XXX = Sig) and DGP * 
NormResults*.mat : results of the simulation for the AUROC curves
                                    
--------------------------
DATA CITATION INFORMATION 
--------------------------

The source data for IP is freely accessible at the Federal Reserve Board webpage under: https://www.federalreserve.gov/releases/g17/current/

The source data for the extended Romer and Romer shock series is "Wieland, Johannes F., and Mu-Jeung Yang. “Financial Dampening.” Journal of Money, Credit and Banking 52, no. 1 (February 2020): 79–113. https://doi.org/10.1111/jmcb.12681."

The source data for the Bauer and Swanson MP shock series is "Bauer, M. D. and Swanson, E. T. (2022), A reassessment of monetary policy surprises and high-frequency identification, Technical report, National Bureau of Economic Research."

The source data for utility adjusted utilization-adjusted TFP series is obtained from the SF FED at https://www.frbsf.org/economic-research/indicators-data/total-factor-productivity-tfp/  and can be cited with "John Fernald. 2014. “A Quarterly, Utilization-Adjusted Series on Total Factor Productivity.” FRBSF Working Paper 2012-19."

The source data for the S&P GSCI commodity index was accessed via Haver Analytics. Data is publicly available at https://ca.investing.com/indices/sp-gsci-commodity-total-return-historical-data

The source data for inventories and shipments are obtained from the Manufacturers’ Shipments, Inventories, and Orders (M3) of the US Census Bureau and are matched with the dispersement table https://www.census.gov/manufacturing/m3/historical_data/dispersement.pdf 

--------------------------
DATA AVAILABILITY STATEMENT 
--------------------------

All source data used to support the findings of this Paper are included within the reproduction package.

--------------------------
DATA-SPECIFIC INFORMATION 
--------------------------

Datafiles: see top
Format: xls, csv, xlsx
brief description: data files start with IP. Main data IP98updated_formulas.xlsx. Sheet nomenclature: The suffix 'L'+number denotes the respective level of disaggregation of industrial production (IP) sectors. The suffix 'w' denotes that it corresponds to the weights for this file. 

Units of measure: Index values (2017 = 100), and weights in the aggregate index (if sheet is suffixed with 'w')

Variable list: The index values are shown for sectoral aggregation as name in IP98.xls

Missing data: The missing data from the original data set is filled in with growth rates from sheet "Growth". This step is done with finding the higher-level data and filling it in as a residual.

Time of download of the main data set: 18 January 2023

