Test Joint Randomly (Risky + Safe Asset + Save + Borr + R Shock + Interpolated-Percentage), 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
- test speed: fsi_ipwkbzr_ds_vecsv_speed_default
- test joint RANDOM: fsi_ipwkbzr_ds_vecsv_joint_default_rand
- test interest rate default: fsi_ipwkbzr_ds_vecsv_default
- test interest rate default RANDOM: fsi_ipwkbzr_ds_vecsv_default_rand
- test interest rate default CROSS: fsi_ipwkbzr_ds_vecsv_default_cross
- test interest rate no default CROSS: fsi_ipwkbzr_ds_vecsv_nbc_cross
- test preference default: fsi_ipwkbzr_ds_vecsv_pref_default
- test preference default CROSS: fsi_ipwkbzr_ds_vecsv_pref_default_cross
- test preference no default CROSS: fsi_ipwkbzr_ds_vecsv_pref_nbc_cross
- test ymin and save r default CROSS: fsi_ipwkbzr_ds_vecsv_price_default_cross
- test ymin and save r no default CROSS: fsi_ipwkbzr_ds_vecsv_price_nbc_cross
- test preference default: fsi_ipwkbzr_ds_vecsv_prod_default
- test production default CROSS: fsi_ipwkbzr_ds_vecsv_prod_default_cross
- test production no default CROSS: fsi_ipwkbzr_ds_vecsv_prod_nbc_cross
- test shock default: fsi_ipwkbzr_ds_vecsv_shk_default
- test shock default CROSS: fsi_ipwkbzr_ds_vecsv_shk_default_cross
- test shock no default CROSS: fsi_ipwkbzr_ds_vecsv_shk_nbc_cross
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 st_simu_type = 'r'; cl_st_param_keys = {'fl_crra','fl_beta','fl_r_save','fl_z_wage_rho','fl_z_wage_sig', 'fl_alpha', 'fl_delta'}; % Generate Benchmark Parameters it_param_set = 9; [param_map, support_map] = ffs_ipwkbzr_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_wage_rho') = linspace(0, 0.985, it_simu_vec_len); param_tstar_map('fl_z_wage_sig') = linspace(0.05, 0.65, it_simu_vec_len); 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);
Single Test
% support_map('bl_replacefile') = true; % st_simu_type = 'g'; % param_tstar_map = containers.Map('KeyType','char', 'ValueType','any'); % param_tstar_map('fl_crra') = [3.5376]; % param_tstar_map('fl_beta') = [0.91173]; % param_tstar_map('fl_r_save') = [0.030564]; % param_tstar_map('fl_z_wage_rho') = [0.9664]; % param_tstar_map('fl_z_wage_sig') = [0.10001]; % param_tstar_map('fl_alpha') = [0.42916]; % param_tstar_map('fl_delta') = [0.123];
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,106,10]; % Simulate along parameters ff_az_test_analyze( ... ar_it_plot_sets, st_simu_type, 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_ipwkbzr//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_ipwkbzr//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_ipwkbzr//test/ff_ipwkbzr_ds_vecsv/mat/ pos = 44 ; key = st_mat_test_prefix ; val = pos = 45 ; key = st_mat_test_suffix ; val = _g12415161718_cr_t2l14 pos = 46 ; key = st_matimg_path_root ; val = C:/Users/fan/CodeDynaAsset//m_ipwkbzr/ pos = 47 ; key = st_profile_name_main ; val = _default pos = 48 ; key = st_profile_path ; val = C:/Users/fan/CodeDynaAsset//m_ipwkbzr//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: 55 KeyType: char ValueType: any xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ---------------------------------------- ---------------------------------------- pos = 4 ; key = cl_st_param_keys ; val = fl_crra pos = 51 ; key = st_analytical_stationary_type ; val = eigenvector pos = 52 ; key = st_model ; val = ipwkbzr pos = 53 ; key = st_v_coh_z_interp_method ; val = method_cell pos = 54 ; key = st_z_r_borr_drv_ele_type ; val = unif pos = 55 ; key = st_z_r_borr_drv_prb_type ; val = poiss ---------------------------------------- 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 7 10.429 7.678 1 18 ---------------------------------------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Scalars in Container and Sizes and Basic Statistics xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx i idx value __ ___ _______ bl_default 1 2 1 bl_loglin 2 3 0 fl_Amean 3 5 1 fl_a_max 4 6 50 fl_a_min 5 7 0 fl_alpha 6 8 0.36 fl_b_bd 7 9 -20 fl_beta 8 10 0.94 fl_c_min 9 11 0.02 fl_coh_interp_grid_gap 10 12 0.1 fl_crra 11 13 1.5 fl_default_wprime 12 14 0 fl_delta 13 15 0.08 fl_k_max 14 16 70 fl_k_min 15 17 0 fl_loglin_threshold 16 18 1 fl_nan_replace 17 19 -9999 fl_r_save 18 20 0.025 fl_tol_dist 19 21 1e-05 fl_tol_pol 20 22 1e-05 fl_tol_val 21 23 1e-05 fl_w 22 24 0.44365 fl_w_interp_grid_gap 23 25 0.1 fl_w_max 24 26 50 fl_w_min 25 27 -20 fl_z_mu 26 28 0 fl_z_r_borr_max 27 29 0.095 fl_z_r_borr_min 28 30 0.025 fl_z_r_borr_n 29 31 5 fl_z_r_borr_poiss_mean 30 32 20 fl_z_rho 31 33 0.8 fl_z_sig 32 34 0.2 fl_z_wage_mu 33 35 0 fl_z_wage_rho 34 36 0.8 fl_z_wage_sig 35 37 0.2 it_a_n 36 38 750 it_ak_perc_n 37 39 50 it_c_interp_grid_gap 38 40 0.0001 it_maxiter_dist 39 41 1000 it_maxiter_val 40 42 250 it_size_type 41 43 2 it_st_simu_type_g_seed 42 44 123 it_st_simu_type_g_simun 43 45 200 it_tol_pol_nochange 44 46 25 it_trans_power_dist 45 47 1000 it_w_perc_n 46 48 50 it_z_n 47 49 55 it_z_wage_n 48 50 11 ---------------------------------------- ---------------------------------------- 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 2 0.4 0.14142 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 2 0.08 0.084853 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 5 0.495 0.39133 0 0.99 fl_z_sig 15 15 1 5 0.255 0.19369 0.01 0.5 fl_z_wage_rho 16 16 1 2 0.4925 0.6965 0 0.985 fl_z_wage_sig 17 17 1 2 0.35 0.42426 0.05 0.65 it_a_n 18 18 1 5 1300 948.68 100 2500 it_z_n 19 19 1 5 15 7.9057 5 25