-
Notifications
You must be signed in to change notification settings - Fork 12
/
fsi_ipwkz_ds_vecsv_prod_cross.m
94 lines (80 loc) · 4.87 KB
/
fsi_ipwkz_ds_vecsv_prod_cross.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
%% Test Production Function (Risky + Safe Asets + Two-Step + Interpolated + Percentage Distribution) (cross)
% *back to <https://fanwangecon.github.io Fan>'s
% <https://fanwangecon.github.io/CodeDynaAsset/ Dynamic Assets Repository>
% Table of Content.* *cross test*: given (x,y), vary x along X, y along Y,
% one at a time
%
% Compare against
% <https://fanwangecon.github.io/CodeDynaAsset/m_akz/test/ff_iwkz_ds_vecsv/test_prod/html/fsi_iwkz_ds_vecsv_prod_cross.html
% fsi_iwkz_ds_vecsv_prod_cross> from *iwkz*. Here, we use *ipwkz*.
%
% @include
%
% * <https://fanwangecon.github.io/CodeDynaAsset/m_az/solvepost/html/ff_az_test_analyze.html ff_az_test_analyze>
% * <https://fanwangecon.github.io/CodeDynaAsset/m_ipwkz/paramfunc/html/ffs_ipwkz_set_default_param.html ffs_ipwkz_set_default_param>
%
% @seealso
%
% * _SPEED_ risky + safe (two-step interp) overall benchmark speed testing: <https://fanwangecon.github.io/CodeDynaAsset/m_ipwkz/test/ff_ipwkz_ds_vecsv/test_speed/html/fsi_ipwkz_ds_vecsv_speed.html fsi_ipwkz_ds_vecsv_speed>
% * _PREFERENCE_ risky + safe (two-step interp) preference testing: <https://fanwangecon.github.io/CodeDynaAsset/m_ipwkz/test/ff_ipwkz_ds_vecsv/test_pref/html/fsi_ipwkz_ds_vecsv_pref.html fsi_ipwkz_ds_vecsv_pref>
% * _PREFERENCE_ risky + safe (two-step interp) preference testing *cross*:
% <https://fanwangecon.github.io/CodeDynaAsset/m_ipwkz/test/ff_ipwkz_ds_vecsv/test_pref/html/fsi_ipwkz_ds_vecsv_pref_cross.html fsi_ipwkz_ds_vecsv_pref_cross>
% * _SHOCK_ risky + safe (two-step interp) shock testing: <https://fanwangecon.github.io/CodeDynaAsset/m_ipwkz/test/ff_ipwkz_ds_vecsv/test_shock/html/fsi_ipwkz_ds_vecsv_shock.html fsi_ipwkz_ds_vecsv_shock>
% * _SHOCK_ risky + safe (two-step interp) shock testing *cross*:
% <https://fanwangecon.github.io/CodeDynaAsset/m_ipwkz/test/ff_ipwkz_ds_vecsv/test_shock/html/fsi_ipwkz_ds_vecsv_shock_cross.html fsi_ipwkz_ds_vecsv_shock_cross>
% * _CAPITAL_ risky + safe (two-step interp) capital return testing: <https://fanwangecon.github.io/CodeDynaAsset/m_ipwkz/test/ff_ipwkz_ds_vecsv/test_prod/html/fsi_ipwkz_ds_vecsv_prod.html fsi_ipwkz_ds_vecsv_prod>
% * _CAPITAL_ risky + safe (two-step interp) capital return testing *cross*: <https://fanwangecon.github.io/CodeDynaAsset/m_ipwkz/test/ff_ipwkz_ds_vecsv/test_prod/html/fsi_ipwkz_ds_vecsv_prod_cross.html fsi_ipwkz_ds_vecsv_prod_cross>
% * _PRICE_ risky + safe (two-step interp) wage and interest rate testing *cross*: adjust wage and savings rate
% <https://fanwangecon.github.io/CodeDynaAsset/m_ipwkz/test/ff_ipwkz_ds_vecsv/test_price/html/fsi_ipwkz_ds_vecsv_price_cross.html fsi_ipwkz_ds_vecsv_price_cross>
% * _JOINT_ all parameters random draws joint test
% <https://fanwangecon.github.io/CodeDynaAsset/m_ipwkz/test/ff_ipwkz_ds_vecsv/test_joint/html/fsi_ipwkz_ds_vecsv_joint_rand.html fsi_ipwkz_ds_vecsv_joint_rand>
%
%% Simulate and Graph
% Note: as for example _fl_beta_ increases, willingness to save increases,
% leading to higher savings, which will exceed the benchmark max grid
% point. So to allow for higher beta, dramatically higher max savings bound
% is needed.
% Set which to graph, simulate over which variables
cl_st_param_keys = {'fl_alpha', 'fl_delta'};
% Generate Benchmark Parameters
it_param_set = 9;
[param_map, support_map] = ffs_ipwkz_set_default_param(it_param_set);
support_map('bl_replacefile') = false;
support_map('bl_graph_onebyones') = true;
support_map('bl_display_graph_stats') = false;
% Generate Arrays of Parameter Values to Loop Over
it_simu_vec_len = 15;
param_tstar_map = containers.Map('KeyType','char', 'ValueType','any');
param_tstar_map('fl_alpha') = linspace(0.30, 0.50, it_simu_vec_len);
param_tstar_map('fl_delta') = linspace(0.02, 0.14, it_simu_vec_len);
%% Medium Grid Simulation (CROSS Limited Graphs)
it_size_type = 2;
ar_it_plot_sets = [3,4,102, 152,104,106];
bl_simu_cross = 'c';
% Simulate along parameters
ff_az_test_analyze( ...
ar_it_plot_sets, bl_simu_cross, it_size_type, cl_st_param_keys, ...
param_map, support_map, param_tstar_map);
close all
%% Larger Grid Simulation (CROSS)
it_size_type = 3;
ar_it_plot_sets = [1,2,101,151, 3,4,102,152, 5,6,103,153, 51,52,53,54, 201,205,207,209, 104,105,106,10];
bl_simu_cross = 'c';
% Simulate along parameters
ff_az_test_analyze( ...
ar_it_plot_sets, bl_simu_cross, it_size_type, cl_st_param_keys, ...
param_map, support_map, param_tstar_map);
close all
%% Denser Simulation (GRID)
it_size_type = 2;
ar_it_plot_sets = [51,52,53,54, 5,6,103,153, 61,62,63,64];
bl_simu_cross = 'g';
it_simu_vec_len = 10;
param_tstar_map = containers.Map('KeyType','char', 'ValueType','any');
param_tstar_map('fl_alpha') = linspace(0.30, 0.50, it_simu_vec_len);
param_tstar_map('fl_delta') = linspace(0.02, 0.14, it_simu_vec_len);
% Simulate along parameters
[tb_outcomes, support_map] = ff_az_test_analyze( ...
ar_it_plot_sets, bl_simu_cross, it_size_type, cl_st_param_keys, ...
param_map, support_map, param_tstar_map);
close all;