This GPcodes_dynare_SIRam.zip file contains the MATLAB/DYNARE replication codes for Fig 1 
of Giagheddu and Papetti (2020), 'The Macroeconomics of Age-Varying Epidemics'.

Link to paper:
https://sites.google.com/view/andreapapetti/home


% -------------------------------------------------------------------------------------------
All codes were written and run with Matlab 2017a and DYNARE 4.6.1. The nonlinear
model is solved and simulated with Dynare's nonlinear deterministic solver 
% -------------------------------------------------------------------------------------------

The files (especially SIRage_macro.mod) contain a lot of comments that describe the codes.

% To replicate Figure 1 [Laissez-faire SIR-age macro model vs canonical SIR-age model]

(1) Replicate canonical SIR-age model [no macroeconomoic interactions due to consumption/work]

--> Run (F5) the Runfile.m in folder SIRage_canonical which runs the SIRage_macro.mod 
which in turn saves all the deterministic simul results into base_SIRage_canonical.mat

(2) Replicate SIR-age macro model [with macroeconomoic interactions due to consumption/work]

--> Run (F5) the Runfile.m in folder SIRage_macro_GP which runs the SIRage_macro.mod 
which in turn saves all the deterministic simul results into base_SIRage_macro_GP.mat

(3) To plot the results of Figure 1, run (F5) the file fig1_replicaDynare.m outside the 2 folders

REMARK: one can switch the numerical resultion from the SIR-age macro model to the canonical
SIR-age model by simply setting do_SIR_canonical=1 in the SIRage_macro.mod file

