-
Notifications
You must be signed in to change notification settings - Fork 12
/
fsi_az_ds_vecsv_shock.m
188 lines (147 loc) · 7.19 KB
/
fsi_az_ds_vecsv_shock.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
%% Test Shock Persistence and Variance (Savings Distribution)
% *back to <https://fanwangecon.github.io Fan>'s
% <https://fanwangecon.github.io/CodeDynaAsset/ Dynamic Assets Repository>
% Table of Content.*
%
% @seealso
%
% * _SPEED_ savings only overall benchmark speed testing: <https://fanwangecon.github.io/CodeDynaAsset/m_az/test/ff_az_ds_vecsv/test_speed/html/fsi_az_ds_vecsv_speed.html fsi_az_ds_vecsv_speed>
% * _PREFERENCE_ savings only preference testing: <https://fanwangecon.github.io/CodeDynaAsset/m_az/test/ff_az_ds_vecsv/test_pref/html/fsi_az_ds_vecsv_pref.html fsi_az_ds_vecsv_pref>
% * _PREFERENCE_ savings only preference testing *CROSS*:
% <https://fanwangecon.github.io/CodeDynaAsset/m_az/test/ff_az_ds_vecsv/test_pref/html/fsi_az_ds_vecsv_pref_cross.html fsi_az_ds_vecsv_pref_cross>
% * _PREFERENCE_ savings only preference testing *GRID*:
% <https://fanwangecon.github.io/CodeDynaAsset/m_az/test/ff_az_ds_vecsv/test_pref/html/fsi_az_ds_vecsv_pref_grid.html fsi_az_ds_vecsv_pref_grid>
% * _SHOCK_ savings only shock testing: <https://fanwangecon.github.io/CodeDynaAsset/m_az/test/ff_az_ds_vecsv/test_shock/html/fsi_az_ds_vecsv_shock.html fsi_az_ds_vecsv_shock>
% * _SHOCK_ savings only shock testing *CROSS*:
% <https://fanwangecon.github.io/CodeDynaAsset/m_az/test/ff_az_ds_vecsv/test_shock/html/fsi_az_ds_vecsv_shock_cross.html fsi_az_ds_vecsv_shock_cross>
% * _SHOCK_ savings only shock testing *GRID*:
% <https://fanwangecon.github.io/CodeDynaAsset/m_az/test/ff_az_ds_vecsv/test_shock/html/fsi_az_ds_vecsv_shock_grid.html fsi_az_ds_vecsv_shock_grid>
% * _PRICE_ savings only wage and interest rate testing *CROSS*: adjust wage and savings rate
% <https://fanwangecon.github.io/CodeDynaAsset/m_az/test/ff_az_ds_vecsv/test_price/html/fsi_az_ds_vecsv_price_cross.html fsi_az_ds_vecsv_price_cross>
% * _JOINT_ all parameters random draws joint test
% <https://fanwangecon.github.io/CodeDynaAsset/m_az/test/ff_az_ds_vecsv/test_joint/html/fsi_az_ds_vecsv_joint_rand.html fsi_az_ds_vecsv_joint_rand>
%
%% Set Shared Parameters
close all;
clear all;
ar_fl_z_rho = [0.0, 0.50, 0.99];
ar_fl_z_sig = [0.05, 0.10, 0.3];
it_a_n = 750;
it_z_n = 15;
%% Simulate Model with schok persistence = 0.0, IID
for fl_z_sig = ar_fl_z_sig
disp('xxxxxxxxxxxxxxxxxxxxxxxxxxx');
disp('xxxxxxxxxxxxxxxxxxxxxxxxxxx');
disp(['fl_z_rho = ' num2str(ar_fl_z_rho(1))]);
disp(['fl_z_sig = ' num2str(fl_z_sig)]);
disp('xxxxxxxxxxxxxxxxxxxxxxxxxxx');
disp('xxxxxxxxxxxxxxxxxxxxxxxxxxx');
disp('');
disp('');
disp('');
disp('');
% Call Default Parameters <https://fanwangecon.github.io/CodeDynaAsset/m_az/paramfunc/html/ffs_az_set_default_param.html ffs_az_set_default_param>
bl_input_override = true;
it_param_set = 9;
[param_map, support_map] = ffs_az_set_default_param(it_param_set);
% Simulation Accuracy
param_map('it_a_n') = it_a_n;
param_map('it_z_n') = it_z_n;
param_map('fl_z_rho') = ar_fl_z_rho(1);
param_map('fl_z_sig') = fl_z_sig;
% Display Parameters
support_map('bl_display') = false;
support_map('bl_display_final') = false;
support_map('bl_time') = true;
support_map('bl_profile') = false;
support_map('bl_graph_coh_t_coh') = true;
% Call Grid Generator <https://fanwangecon.github.io/CodeDynaAsset/m_az/paramfunc/html/ffs_az_get_funcgrid.html ffs_az_get_funcgrid>
[armt_map, func_map] = ffs_az_get_funcgrid(param_map, support_map, bl_input_override);
% Call Dynamic Programming Problem <https://fanwangecon.github.io/CodeDynaAsset/m_az/solve/html/ff_az_vf_vecsv.html ff_az_vf_vecsv>
result_map = ff_az_vf_vecsv(param_map, support_map, armt_map, func_map);
% Call Distribution CProgram
result_map = ff_az_ds_vecsv(param_map, support_map, armt_map, func_map, result_map, bl_input_override);
% Snap
snapnow;
end
% close all
close all;
%% Simulate Model with schok persistence = 0.5
close all
for fl_z_sig = ar_fl_z_sig
disp('xxxxxxxxxxxxxxxxxxxxxxxxxxx');
disp('xxxxxxxxxxxxxxxxxxxxxxxxxxx');
disp(['fl_z_rho = ' num2str(ar_fl_z_rho(2))]);
disp(['fl_z_sig = ' num2str(fl_z_sig)]);
disp('xxxxxxxxxxxxxxxxxxxxxxxxxxx');
disp('xxxxxxxxxxxxxxxxxxxxxxxxxxx');
disp('');
disp('');
disp('');
disp('');
% Call Default Parameters <https://fanwangecon.github.io/CodeDynaAsset/m_az/paramfunc/html/ffs_az_set_default_param.html ffs_az_set_default_param>
bl_input_override = true;
it_param_set = 9;
[param_map, support_map] = ffs_az_set_default_param(it_param_set);
% Simulation Accuracy
param_map('it_a_n') = it_a_n;
param_map('it_z_n') = it_z_n;
param_map('fl_z_rho') = ar_fl_z_rho(2);
param_map('fl_z_sig') = fl_z_sig;
% Display Parameters
support_map('bl_display') = false;
support_map('bl_display_final') = false;
support_map('bl_time') = true;
support_map('bl_profile') = false;
support_map('bl_graph_coh_t_coh') = true;
% Call Grid Generator <https://fanwangecon.github.io/CodeDynaAsset/m_az/paramfunc/html/ffs_az_get_funcgrid.html ffs_az_get_funcgrid>
[armt_map, func_map] = ffs_az_get_funcgrid(param_map, support_map, bl_input_override);
% Call Dynamic Programming Problem <https://fanwangecon.github.io/CodeDynaAsset/m_az/solve/html/ff_az_vf_vecsv.html ff_az_vf_vecsv>
result_map = ff_az_vf_vecsv(param_map, support_map, armt_map, func_map);
% Call Distribution CProgram
result_map = ff_az_ds_vecsv(param_map, support_map, armt_map, func_map, result_map, bl_input_override);
% Snap
snapnow;
end
% close all
close all;
%% Simulate Model with schok persistence = 0.99 (very persistent)
close all
for fl_z_sig = ar_fl_z_sig
disp('xxxxxxxxxxxxxxxxxxxxxxxxxxx');
disp('xxxxxxxxxxxxxxxxxxxxxxxxxxx');
disp(['fl_z_rho = ' num2str(ar_fl_z_rho(3))]);
disp(['fl_z_sig = ' num2str(fl_z_sig)]);
disp('xxxxxxxxxxxxxxxxxxxxxxxxxxx');
disp('xxxxxxxxxxxxxxxxxxxxxxxxxxx');
disp('');
disp('');
disp('');
disp('');
% Call Default Parameters <https://fanwangecon.github.io/CodeDynaAsset/m_az/paramfunc/html/ffs_az_set_default_param.html ffs_az_set_default_param>
bl_input_override = true;
it_param_set = 9;
[param_map, support_map] = ffs_az_set_default_param(it_param_set);
% Simulation Accuracy
param_map('it_a_n') = it_a_n;
param_map('it_z_n') = it_z_n;
param_map('fl_z_rho') = ar_fl_z_rho(3);
param_map('fl_z_sig') = fl_z_sig;
% Display Parameters
support_map('bl_display') = false;
support_map('bl_display_final') = false;
support_map('bl_time') = true;
support_map('bl_profile') = false;
support_map('bl_graph_coh_t_coh') = true;
% Call Grid Generator <https://fanwangecon.github.io/CodeDynaAsset/m_az/paramfunc/html/ffs_az_get_funcgrid.html ffs_az_get_funcgrid>
[armt_map, func_map] = ffs_az_get_funcgrid(param_map, support_map, bl_input_override);
% Call Dynamic Programming Problem <https://fanwangecon.github.io/CodeDynaAsset/m_az/solve/html/ff_az_vf_vecsv.html ff_az_vf_vecsv>
result_map = ff_az_vf_vecsv(param_map, support_map, armt_map, func_map);
% Call Distribution CProgram
result_map = ff_az_ds_vecsv(param_map, support_map, armt_map, func_map, result_map, bl_input_override);
% Snap
snapnow;
end
% close all
close all;
clear all;