-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexperiments.m
146 lines (99 loc) · 4.36 KB
/
experiments.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
%% Plot results of counterfactual experiments
oldpath = fullfile(pwd,'');
% Load results of baseline simulation
load results_baseline
% load counterfactual results
if experiment_num == 1
load informal_z_fixed
elseif experiment_num==2
load informal_alltax_fixed
elseif experiment_num==3
load informal_z_fixed
load informal_tw_only
elseif experiment_num==4
load informal_z_fixed
load informal_te_only
elseif experiment_num==5
load informal_z_fixed
load informal_s_only
end
% Save plots in subfolder results\experiments
cd 'results\experiments'
if experiment_num == 1
% EXPERIMENT 1: Keep z(t) fixed at 2000 lovel
plot(year_vec,informal_z_fixed*100,'-o',year_vec,informal_baseline*100,'linewidth',2)
legend('z(t)=2000','baseline'), grid on
%title('Informal sector size, over Y')
xlabel('Year')
ylabel('Informal Economy as % of GDP')
print('informal_z_fixed','-depsc')
print('informal_z_fixed','-dpng')
savefig('informal_z_fixed')
elseif experiment_num==2
% EXPERIMENT 2: Keep all taxes fixed at 2000 lovel
plot(year_vec,informal_alltax_fixed*100,'-o',year_vec,informal_baseline*100,'linewidth',2)
legend('taxes=2000','baseline'), grid on
%title('Informal sector size, over Y')
xlabel('Year')
ylabel('Informal Economy as % of GDP')
print('informal_alltax_fixed','-depsc')
print('informal_alltax_fixed','-dpng')
savefig('informal_alltax_fixed')
elseif experiment_num==3
% EXPERIMENT 3: only T_W changes, other taxes are freezed (z changes)
plot(year_vec,informal_tw_only*100,'-o',year_vec,informal_z_fixed*100,'linewidth',2)
legend('T_{W} only','all taxes','Location','Best'), grid on
%title('Informal sector size, over Y')
xlabel('Year')
ylabel('Informal Economy as % of GDP')
print('informal_tw_only','-depsc')
print('informal_tw_only','-dpng')
savefig('informal_tw_only')
elseif experiment_num==4
% EXPERIMENT 4: only T_E changes, other taxes are freezed
plot(year_vec,informal_te_only*100,'-o',year_vec,informal_z_fixed*100,'linewidth',2)
legend('T_{E} only','all taxes'), grid on
%title('Informal sector size, over Y')
xlabel('Year')
ylabel('Informal Economy as % of GDP')
print('informal_te_only','-depsc')
print('informal_te_only','-dpng')
savefig('informal_te_only')
elseif experiment_num==5
% EXPERIMENT 5: only S_E and S_W change, other taxes are freezed
plot(year_vec,informal_s_only*100,'-o',year_vec,informal_z_fixed*100,'linewidth',2)
legend('S only','all taxes'), grid on
%title('Informal sector size, over Y')
xlabel('Year')
ylabel('Informal Economy as % of GDP')
print('informal_s_only','-depsc')
print('informal_s_only','-dpng')
savefig('informal_s_only')
end
%% Table summarizing the findings
cd(oldpath)
load informal_z_fixed
load informal_alltax_fixed
cd 'results\experiments'
fid=fopen('results_table.tex','w');
fprintf(fid,'\n \\documentclass[12pt]{article}');
fprintf(fid,'\n \\begin{document}');
fprintf(fid,'\n \\begin{table}[h]');
fprintf(fid,'\n \\caption{Decomposing the change in Informality: Taxes vs Productivity}');
fprintf(fid,'\n \\begin{center}');
fprintf(fid,'\n \\label{results1}');
fprintf(fid,'\n \\begin{tabular}{lccc}');
%fprintf(fid,'\n \\multicolumn{4}{c}{$\\tau_t$} \\\\');
fprintf(fid,'\n & 2000 & 2014 & Change \\\\ \\hline');
fprintf(fid,'\n Data & $%5.2f$ & $%5.2f$ & $%5.2f$ \\\\ ',36.9, 31,-5.90);
fprintf(fid,'\n Model & $%5.2f$ & $%5.2f$ & $%5.2f$ \\\\ ',informal_baseline(1)*100,informal_baseline(end)*100,(informal_baseline(end)-informal_baseline(1))*100);
fprintf(fid,'\n Change taxes only & $%5.2f$ & $%5.2f$ & $%5.2f$ \\\\ ',informal_z_fixed(1)*100,informal_z_fixed(end)*100,(informal_z_fixed(end)-informal_z_fixed(1))*100);
fprintf(fid,'\n Change productivity only & $%5.2f$ & $%5.2f$ & $%5.2f$ \\\\ ',informal_alltax_fixed(1)*100,informal_alltax_fixed(end)*100,(informal_alltax_fixed(end)-informal_alltax_fixed(1))*100);
fprintf(fid,'\n \\hline');
fprintf(fid,'\n \\end{tabular}');
fprintf(fid,'\n \\end{center}');
fprintf(fid,'\n \\end{table}');
fprintf(fid,'\n \\end{document}');
fclose(fid);
%% Go back to the main folder
cd(oldpath)