README file for the replication package accompanying
"Matching Theory and Evidence on Covid-19 using a Stochastic Network SIR Model" 
by M. Hashem Pesaran and Cynthia Fan Yang, September 1, 2021


DATA
====

All relevant data used in the study are stored in `./data_raw/`.

-- The subfolder `./20210618/` contains the raw data on Covid-19 cases and the 
population for the six European countries and the US. The case data for Austria,
Germany, Italy, the UK, and the US were retrieved from the CSSE's repository at 
Johns Hopkins University on June 19, 2021. The case data for France and Spain 
were sourced from the WHO database on the same day.

-- The subfolder `./20210805/` contains the raw data on Covid-19 cases and the 
population for the six European countries and the US retrieved from the same 
sources on August 6, 2021. These more recent data were only used in comparing 
the total number of cases, as shown in Figure S.11.

-- `cases_states_20210807.csv` contains the reported case numbers and population 
for all the contiguous states in the US. The data at the county level were 
retrieved from the CSSE's repository on August 8, 2021.

-- `Germany_contact_L5.csv` and `Germany_population_L5.csv` contains the German
contact and population data for the five-age groups. These data were used in the
simulations of the multigroup model.

-- `vacc_dates.csv` contains the dates when the share of the population fully 
vaccinated reached 10 and 15 percent for the selected European countries and the
US. The joint estimation exercise uses these dates as stopping criteria.

Please refer to Section S8 of the online supplement for more details on the data 
sources.


PROGRAMS
========

The following main programs produce the results reported in the main paper and 
the online supplement. The Matlab scripts are used in all the calibration, 
estimation, and simulation exercises. The R scripts are used in plotting the fan
charts. Please run the programs for each section in the order listed so that the
necessary inputs are computed first. All generated figures will be stored in 
`./paper/figs/` (an empty folder needs to be created first).

Note: Tables and figures in the online supplement are indicated with the prefix 
"S." (e.g., Table S.1 and Figure S.1).


Calibration and Simulation
--------------------------

-- `gen_contact_matrix.m` constructs the contact matrix based on the five age 
groups and prepares relevant data to be used in the multigroup simulation.

-- `main_theory_vaccination.m` simulates the single- and multi-group models 
without containment measures, as well as the counterfactual outcomes under 
social distancing and/or vaccination.

-- `sum_theory_cmp_pop_PL.m` compares the simulation results under different 
population sizes and network topologies, generates the third panel in Figure 
S.4, and saves results in csv for creating fan charts in R.

-- `plot_networks.m` generates Figure S.3.

-- `plot_theory_singlegroup.R` generates Figure S.1 and the fan charts in Figure
S.4.


Estimation using Simulated Data
-------------------------------

-- `estimation_theory_const_beta.m` carries out the rolling estimation of the 
transmission rate. The results are reported in Tables 1 and S.1.

-- `estimation_theory_gamma.m` carries out the rolling estimation of the 
recovery rate. The results are reported in Table S.2.


Matching the Model with Empirical Evidence
------------------------------------------

-- `main_empirical_recursive_auto.m` implements the method that jointly 
estimates the transmission rates and multiplication factor for selected European
countries and the US.

-- `sum_empirical_MF.m` generates Figures 2, 3, S.6, S.11, the right panel of 
Figure S.8, and the left panel of Figure S.12.

-- `sum_empirical_cmp_window.m` generates Figures S.7 and S.10.

-- `plot_empirical_cmp_MF.m` generates Figure S.5 and the left panel of Figure 
S.8.

-- `plot_empirical_match_recursive.R` generates Figure 4 and the right panel of 
Figure S.12.

-- `dataprep_US_states.m` prepares data to be used in the estimation of the 
reproduction numbers for the US by state.

-- `estimation_US_states` estimates the reproduction numbers for each state and 
generates Figure S.9.


Counterfactual -- Social Distancing and Vaccination
---------------------------------------------------

-- `main_theory_vaccination.m` simulates the single- and multi-group models 
without containment measures, as well as the counterfactual outcomes under 
social distancing and/or vaccination.

-- `plot_theory_vacc_cmp_frac.m`, `plot_theory_vacc_cmp_wbeg.m`, 
`plot_theory_vacc_cmp_weeks.m`, `plot_theory_vacc_cmp_efficacy.m`. These scripts
generate Figure S.14 (a)--(d).

-- `sum_theory_vaccination_results.m` compares the results obtained by the 
single- vs. multi-group models, saves results under no containment measures in 
csv for creating fan charts, and generates Figures 5, 6, S.2, S.13, and S.15.

-- `plot_theory_multigroup.R` generates Figure 1.


Counterfactual -- Early Interventions
-------------------------------------

-- `main_empirical_counterfactual.m` simulates the counterfactual outcomes of 
early interventions in the UK and Germany.

-- `sum_empirical_counterfactual.m` summarizes the counterfactual outcomes of 
early interventions in the UK and Germany, saves results in csv for creating fan 
charts, and plots the reproduction numbers in Figures 7 and S.16.

-- `plot_empirical_counterfactual.R` generates the fan charts in Figures 7 and 
S.16.


Please address any questions to:

Cynthia Yang
Florida State University
cynthia.yang [AT] fsu.edu