This folder replicates the baseline model in "Policy Uncertainty and Aggregate Fluctuations: Evidence from Emerging and Developed Economies"
By Haroon Mumtaz and Franz Ruch.

Data for the baseline model are saved in the "data" folder. Please refer to section 4 from the paper for details of the data collected, 
sources, and transformations.

The code requires matlab to run. 

This code produces the data to construct Figure 8 and fully produces figures A4.1 and A4.2 in the paper.

The folder "benchmark", contains the following:

-"estimate5_fe_10.m" is the main file that estimates the model.

-"get_irf_fevd.m" produces mat files that contain the IRFs and FEVDs.

-"extract_uncertainty_measures.m" produces the fiscal and monetary policy uncertainty measures used in the paper. The code produces an excel
file called "Unc.xls" with tabs for goverment spending uncertainty (g) and real interest rate uncertainty (r). These tabs are used to generate
figure 2. 

-"CF.m" and "plot_cf_gdp.m" produces the counterfactual analysis. "CF.m" produces an excel called "CF.xls". The excel includes tabs for seperate 
country and uncertainty cases where EMDEs are colloquially refered to as "poor" and advanced economies as "rich". 
For example: 
    -Figure 8B is generated from tab "no_pol_poor" for EMDEs in blue, and from tab "no_pol_rich" for Advanced economies in red. 
    -Figure 8C is generated from tab "no_g_poor". 
    -Figure 8D is generated from tab "no_mp_poor". 

-"plot_cf_gdp.m" provides examples of how the resulting counterfactuals can produce charts.   

The folder also contains code to replicate figures A4.2 (plot_levels_irfs_f.m) and A4.1 (plot_vol_irfs_f.m).

The "functions" folder contains additional functions that are necessary to estimate the baseline model.



