The main code that solves and simulates the model is MAIN.m, which solves 3 variants of the model: with labor mobility 
and fiscal competition, with labor mobility and no fiscal competition and the model without labor mobility. The option WELFARE_COMP allows 
to choose whether the computations related to welfare analysis are performed or not (the latter option makes computations significantly
shorter). It also plots all the figures and reports the results in tables from the paper. The logic behind the solution algorithm MAIN.m is presented in the Appendix
to our paper.

MAIN.m calls the following external functions/scripts:

1) tauchen.m - discretizes the productivity process at the country level
2) splines.m - performs the spline approximation
3) Uy_eval.m - evaluation of the value of the lifetime utility of the young
4) Uy_b_eval.m - evaluation of the derivative of the  lifetime utility of the young with respect to b'
5) Chi_eval.m - evaluates penalty function
6) w_eval.m - evaluates the value of real wage
7) w_d_eval.m - evaluates the derivative of t  real wage with respect to default decision
8) d_optimal.m - function that solves for optimal default policy and finds the treshold value for b
9) Gamma_approx.m - approximation of derivative of function Gamma
10) bond_prices.m - function that computes bond prices
11) q_approx2.m - computes the derivative of bond price q
12) Uy_val_g.m - evaluates the expected utility from consumption of public goods
13) Psi_fun.m - computes the value of function Psi
14) P_phi_comp.m - computes the value of function Phi
15) pruning_eta.m - function that prunes ETA and C_equiv so that it is more efficiently approximated with splines
16) eta_eval.m - function that evaluates eta
17) eta_deriv_eval.m - function that evaluates derivative of eta
18) SavingResults.m - saves the results generated by three variants of the model which are then used to generate plots
19) ReportsAndPlots.m - script that reports the moments generated by the model and plots figures

Created Sept 15, 2021  



