Test Joint Randomly (Risky + Safe Asets + Two-Step + Interpolated + Percentage Distribution), Test Preference, Price and Shocks

back to Fan's Dynamic Assets Repository Table of Content. cross test: given (x,y), vary x along X, y along Y, one at a time

Compare against fsi_iwkz_ds_vecsv_joint_rand from iwkz. Here, we use ipwkz.

@include

@seealso

Contents

Simulate and Graph

Randomly draw 100 sets of parameters based on the min and max grids

% Set which to graph, simulate over which variables
bl_simu_cross = 'r';
cl_st_param_keys = {'fl_crra','fl_beta','fl_r_save','fl_z_rho','fl_z_sig'};

% Generate Benchmark Parameters
it_param_set = 9;
[param_map, support_map] = ffs_ipwkz_set_default_param(it_param_set);

param_map('it_st_simu_type_g_seed') = 123;
param_map('it_st_simu_type_g_simun') = 200;

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 = 2;
param_tstar_map = containers.Map('KeyType','char', 'ValueType','any');
param_tstar_map('fl_crra') = linspace(1, 5, it_simu_vec_len);
param_tstar_map('fl_beta') = linspace(0.87, 0.97, it_simu_vec_len);
param_tstar_map('fl_r_save') = linspace(0, 0.06, it_simu_vec_len);
param_tstar_map('fl_z_rho') = linspace(0, 0.985, it_simu_vec_len);
param_tstar_map('fl_z_sig') = linspace(0.05, 0.65, it_simu_vec_len);

Medium Grid Simulation

it_size_type = 2;
ar_it_plot_sets = [1,2,101, 3,4,102, 5,6,103, 51,52,53, 201,205,207, 104,105,106];

% 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
----------------------------------------
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Begin: Show all key and value pairs from container
CONTAINER NAME: SUPPORT_MAP
----------------------------------------
  Map with properties:

        Count: 51
      KeyType: char
    ValueType: any

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
----------------------------------------
----------------------------------------
pos = 34 ; key = st_img_name_main ; val = _default
pos = 35 ; key = st_img_path ; val = C:/Users/fan/CodeDynaAsset//m_ipwkz//solve/img/
pos = 36 ; key = st_img_prefix ; val = 
pos = 37 ; key = st_img_suffix ; val = _p9.png
pos = 38 ; key = st_mat_name_main ; val = _default
pos = 39 ; key = st_mat_path ; val = C:/Users/fan/CodeDynaAsset//m_ipwkz//solve/mat/
pos = 40 ; key = st_mat_prefix ; val = 
pos = 41 ; key = st_mat_suffix ; val = _p9
pos = 42 ; key = st_mat_test_name_main ; val = r
pos = 43 ; key = st_mat_test_path ; val = C:/Users/fan/CodeDynaAsset//m_ipwkz//test/ff_ipwkz_ds_vecsv/mat/
pos = 44 ; key = st_mat_test_prefix ; val = 
pos = 45 ; key = st_mat_test_suffix ; val = _g12456_cr_t2l10
pos = 46 ; key = st_matimg_path_root ; val = C:/Users/fan/CodeDynaAsset//m_ipwkz/
pos = 47 ; key = st_profile_name_main ; val = _default
pos = 48 ; key = st_profile_path ; val = C:/Users/fan/CodeDynaAsset//m_ipwkz//solve/profile/
pos = 49 ; key = st_profile_prefix ; val = 
pos = 50 ; key = st_profile_suffix ; val = _p9
pos = 51 ; key = st_title_prefix ; val = 
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Scalars in Container and Sizes and Basic Statistics
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                                    i     idx    value
                                    __    ___    _____

    bl_display                       1     1        0 
    bl_display_defparam              2     2        0 
    bl_display_dist                  3     3        0 
    bl_display_evf                   4     4        0 
    bl_display_final                 5     5        0 
    bl_display_final_dist            6     6        1 
    bl_display_final_dist_detail     7     7        0 
    bl_display_funcgrids             8     8        0 
    bl_display_graph_stats           9     9        0 
    bl_display_simu_stats           10    10        1 
    bl_graph                        11    11        0 
    bl_graph_coh_t_coh              12    12        0 
    bl_graph_evf                    13    13        0 
    bl_graph_funcgrids              14    14        0 
    bl_graph_funcgrids_detail       15    15        0 
    bl_graph_onebyones              16    16        1 
    bl_graph_pol_lvl                17    17        0 
    bl_graph_pol_pct                18    18        0 
    bl_graph_val                    19    19        0 
    bl_img_save                     20    20        0 
    bl_mat                          21    21        0 
    bl_mat_test                     22    22        1 
    bl_post                         23    23        1 
    bl_profile                      24    24        0 
    bl_profile_dist                 25    25        0 
    bl_replacefile                  26    26        0 
    bl_time                         27    27        1 
    bl_timer                        28    28        1 
    it_display_every                29    29       20 
    it_display_final_colmax         30    30       12 
    it_display_final_rowmax         31    31      100 
    it_display_summmat_colmax       32    32        7 
    it_display_summmat_rowmax       33    33        7 

----------------------------------------
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Begin: Show all key and value pairs from container
CONTAINER NAME: PARAM_MAP
----------------------------------------
  Map with properties:

        Count: 43
      KeyType: char
    ValueType: any

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
----------------------------------------
----------------------------------------
pos = 3 ; key = cl_st_param_keys ; val = fl_crra
pos = 42 ; key = st_analytical_stationary_type ; val = eigenvector
pos = 43 ; key = st_model ; val = ipwkz
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Matrix in Container and Sizes and Basic Statistics
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                         i    idx    rowN    colN    mean     std      min    max
                         _    ___    ____    ____    ____    ______    ___    ___

    ar_param_keys_idx    1     1      1       5      3.6     2.0736     1      6 

----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Scalars in Container and Sizes and Basic Statistics
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                               i     idx     value 
                               __    ___    _______

    bl_loglin                   1     2           0
    fl_Amean                    2     4           1
    fl_a_max                    3     5          50
    fl_a_min                    4     6           0
    fl_alpha                    5     7        0.36
    fl_b_bd                     6     8           0
    fl_beta                     7     9        0.94
    fl_c_min                    8    10        0.02
    fl_coh_interp_grid_gap      9    11         0.1
    fl_crra                    10    12         1.5
    fl_delta                   11    13        0.08
    fl_k_max                   12    14          50
    fl_k_min                   13    15           0
    fl_loglin_threshold        14    16           1
    fl_nan_replace             15    17       -9999
    fl_r_borr                  16    18       0.095
    fl_r_save                  17    19       0.025
    fl_tol_dist                18    20       1e-05
    fl_tol_pol                 19    21       1e-05
    fl_tol_val                 20    22       1e-05
    fl_w                       21    23     0.44365
    fl_w_interp_grid_gap       22    24         0.1
    fl_w_max                   23    25          50
    fl_w_min                   24    26           0
    fl_z_mu                    25    27           0
    fl_z_rho                   26    28         0.8
    fl_z_sig                   27    29         0.2
    it_a_n                     28    30         750
    it_ak_perc_n               29    31          50
    it_c_interp_grid_gap       30    32      0.0001
    it_maxiter_dist            31    33        1000
    it_maxiter_val             32    34         250
    it_size_type               33    35           2
    it_st_simu_type_g_seed     34    36         123
    it_st_simu_type_g_simun    35    37         200
    it_tol_pol_nochange        36    38          25
    it_trans_power_dist        37    39        1000
    it_w_perc_n                38    40          50
    it_z_n                     39    41          15

----------------------------------------
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Begin: Show all key and value pairs from container
CONTAINER NAME: PARAM_TSTAR_MAP
----------------------------------------
  Map with properties:

        Count: 19
      KeyType: char
    ValueType: any

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
----------------------------------------
----------------------------------------
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Matrix in Container and Sizes and Basic Statistics
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                              i     idx    rowN    colN     mean       std        min      max 
                              __    ___    ____    ____    ______    ________    _____    _____

    fl_a_max                   1     1      1       5          65      11.859       50       80
    fl_alpha                   2     2      1       5         0.4    0.079057      0.3      0.5
    fl_b_bd                    3     3      1       5       -12.5      5.9293      -20       -5
    fl_beta                    4     4      1       2        0.92    0.070711     0.87     0.97
    fl_c_min                   5     5      1       5      0.0155    0.011463    0.001     0.03
    fl_crra                    6     6      1       2           3      2.8284        1        5
    fl_delta                   7     7      1       5        0.08    0.047434     0.02     0.14
    fl_r_borr                  8     8      1       5       0.125    0.098821        0     0.25
    fl_r_save                  9     9      1       2        0.03    0.042426        0     0.06
    fl_w                      10    10      1       5        1.25     0.11859      1.1      1.4
    fl_z_r_borr_max           11    11      1       5      0.1225    0.021741    0.095     0.15
    fl_z_r_borr_n             12    12      1       6          15      7.4833        5       25
    fl_z_r_borr_poiss_mean    13    13      1       5        12.5      5.9293        5       20
    fl_z_rho                  14    14      1       2      0.4925      0.6965        0    0.985
    fl_z_sig                  15    15      1       2        0.35     0.42426     0.05     0.65
    fl_z_wage_rho             16    16      1       5       0.495     0.39133        0     0.99
    fl_z_wage_sig             17    17      1       5       0.255     0.19369     0.01      0.5
    it_a_n                    18    18      1       5        1300      948.68      100     2500
    it_z_n                    19    19      1       5          15      7.9057        5       25