Set Model Parameters (Interpolated + Percentage + Risky + Safe Asset + FIBS)
back to Fan's Dynamic Assets Repository Table of Content.
Contents
- FFS_IPWKBZ_FIBS_SET_DEFAULT_PARAM setting model default parameters
- Default
- 1. Initiate Param_map
- 2a. Borrowing Default Parameters
- 2b. Set Borrowing Control Parameters
- 3. Set Interest Rates non-Shock Parameters
- Setting support_map container
- Display New Parameters
- 3. Merge Parameters Import
- Add on based on existing
- Subset Options Adjustments
- Subset Options for Distribution solutions
- Display All Parameters
function [param_map, support_map] = ffs_ipwkbz_fibs_set_default_param(varargin)
FFS_IPWKBZ_FIBS_SET_DEFAULT_PARAM setting model default parameters
@include
Default
it_subset = 4; if (isempty(varargin)) bl_display_defparam = true; else bl_display_defparam = false; end default_params = {it_subset bl_display_defparam}; [default_params{1:length(varargin)}] = varargin{:}; [it_subset, bl_display_defparam] = default_params{:};
1. Initiate Param_map
param_map = containers.Map('KeyType','char', 'ValueType','any'); % model name param_map('st_model') = 'ipwkbz_fibs';
2a. Borrowing Default Parameters
param_map('fl_b_bd') = -20; param_map('fl_w_min') = param_map('fl_b_bd'); param_map('fl_w_max') = 50; param_map('fl_k_max') = (param_map('fl_w_max') - param_map('fl_b_bd')); param_map('fl_c_min') = 0.02; param_map('fl_default_wprime') = 0; % wprime not a prime param_map('bl_default') = true; % if borrowing is default allowed
2b. Set Borrowing Control Parameters
Borrowing Setting 1: Default Allowed, Bridge True, bl_rollover does not matter Borrowing Setting 2: Default Allowed, Bridge False, bl_rollover matter
param_map('bl_default') = true; % if borrowing is default allowed param_map('bl_bridge') = true; param_map('bl_rollover') = true; param_map('bl_b_is_principle') = true;
3. Set Interest Rates non-Shock Parameters
% formal informal parameters % fl_for_br_block are the formal borrowing grid block sizes. param_map('fl_r_fsv') = 0.025; param_map('fl_r_inf') = 0.095; param_map('fl_r_fbr') = 0.065; param_map('bl_b_is_principle') = true; % see: ffs_for_br_block.m param_map('st_forbrblk_type') = 'seg3'; param_map('fl_forbrblk_brmost') = -19; param_map('fl_forbrblk_brleast') = -1; param_map('fl_forbrblk_gap') = -1.5;
Setting support_map container
support_map = containers.Map('KeyType','char', 'ValueType','any'); % Additional Controls support_map('bl_display_minccost') = false; support_map('bl_display_infbridge') = false; support_map('bl_graph_funcgrids') = false; support_map('bl_graph_funcgrids_detail') = false; support_map('bl_display_funcgrids') = false; support_map('bl_graph_forinf_discrete') = true; support_map('bl_graph_forinf_pol_lvl') = true; support_map('bl_graph_forinf_pol_pct') = true; % root directory [st_root_path] = preamble(false); st_matimg_path_root = [st_root_path '/m_fibs/']; support_map('st_matimg_path_root') = st_matimg_path_root; support_map('st_profile_path') = [st_matimg_path_root '/m_ipwkbz_solve/profile/']; support_map('st_mat_path') = [st_matimg_path_root '/m_ipwkbz_solve/mat/']; support_map('st_img_path') = [st_matimg_path_root '/m_ipwkbz_solve/img/']; support_map('st_mat_test_path') = [st_matimg_path_root '/test/ff_ipwkbz_ds_vecsv/mat/'];
Display New Parameters
if (bl_display_defparam) disp('----------------------------------------'); disp('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); disp('Display Parameters Specific to IPWKBZ_FIBS') disp('it_coh_bridge_perc_n ADDED ON NEXT') disp('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); fft_container_map_display(param_map); fft_container_map_display(support_map); end
---------------------------------------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Display Parameters Specific to IPWKBZ_FIBS it_coh_bridge_perc_n ADDED ON NEXT xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ---------------------------------------- ---------------------------------------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Begin: Show all key and value pairs from container CONTAINER NAME: PARAM_MAP ---------------------------------------- Map with properties: Count: 18 KeyType: char ValueType: any xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ---------------------------------------- ---------------------------------------- pos = 1 ; key = bl_b_is_principle ; val = true pos = 2 ; key = bl_bridge ; val = true pos = 3 ; key = bl_default ; val = true pos = 4 ; key = bl_rollover ; val = true pos = 5 ; key = fl_b_bd ; val = -20 pos = 6 ; key = fl_c_min ; val = 0.02 pos = 7 ; key = fl_default_wprime ; val = 0 pos = 8 ; key = fl_forbrblk_brleast ; val = -1 pos = 9 ; key = fl_forbrblk_brmost ; val = -19 pos = 10 ; key = fl_forbrblk_gap ; val = -1.5 pos = 11 ; key = fl_k_max ; val = 70 pos = 12 ; key = fl_r_fbr ; val = 0.065 pos = 13 ; key = fl_r_fsv ; val = 0.025 pos = 14 ; key = fl_r_inf ; val = 0.095 pos = 15 ; key = fl_w_max ; val = 50 pos = 16 ; key = fl_w_min ; val = -20 pos = 17 ; key = st_forbrblk_type ; val = seg3 pos = 18 ; key = st_model ; val = ipwkbz_fibs ---------------------------------------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Scalars in Container and Sizes and Basic Statistics xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx i idx value __ ___ _____ bl_b_is_principle 1 1 1 bl_bridge 2 2 1 bl_default 3 3 1 bl_rollover 4 4 1 fl_b_bd 5 5 -20 fl_c_min 6 6 0.02 fl_default_wprime 7 7 0 fl_forbrblk_brleast 8 8 -1 fl_forbrblk_brmost 9 9 -19 fl_forbrblk_gap 10 10 -1.5 fl_k_max 11 11 70 fl_r_fbr 12 12 0.065 fl_r_fsv 13 13 0.025 fl_r_inf 14 14 0.095 fl_w_max 15 15 50 fl_w_min 16 16 -20 ---------------------------------------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Strings in Container and Sizes and Basic Statistics xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx i idx _ ___ st_forbrblk_type 1 17 st_model 2 18 ---------------------------------------- ---------------------------------------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Begin: Show all key and value pairs from container CONTAINER NAME: SUPPORT_MAP ---------------------------------------- Map with properties: Count: 13 KeyType: char ValueType: any xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ---------------------------------------- ---------------------------------------- pos = 1 ; key = bl_display_funcgrids ; val = false pos = 2 ; key = bl_display_infbridge ; val = false pos = 3 ; key = bl_display_minccost ; val = false pos = 4 ; key = bl_graph_forinf_discrete ; val = true pos = 5 ; key = bl_graph_forinf_pol_lvl ; val = true pos = 6 ; key = bl_graph_forinf_pol_pct ; val = true pos = 7 ; key = bl_graph_funcgrids ; val = false pos = 8 ; key = bl_graph_funcgrids_detail ; val = false pos = 9 ; key = st_img_path ; val = C:/Users/fan/CodeDynaAsset//m_fibs//m_ipwkbz_solve/img/ pos = 10 ; key = st_mat_path ; val = C:/Users/fan/CodeDynaAsset//m_fibs//m_ipwkbz_solve/mat/ pos = 11 ; key = st_mat_test_path ; val = C:/Users/fan/CodeDynaAsset//m_fibs//test/ff_ipwkbz_ds_vecsv/mat/ pos = 12 ; key = st_matimg_path_root ; val = C:/Users/fan/CodeDynaAsset//m_fibs/ pos = 13 ; key = st_profile_path ; val = C:/Users/fan/CodeDynaAsset//m_fibs//m_ipwkbz_solve/profile/ ---------------------------------------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Scalars in Container and Sizes and Basic Statistics xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx i idx value _ ___ _____ bl_display_funcgrids 1 1 0 bl_display_infbridge 2 2 0 bl_display_minccost 3 3 0 bl_graph_forinf_discrete 4 4 1 bl_graph_forinf_pol_lvl 5 5 1 bl_graph_forinf_pol_pct 6 6 1 bl_graph_funcgrids 7 7 0 bl_graph_funcgrids_detail 8 8 0 ---------------------------------------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Strings in Container and Sizes and Basic Statistics xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx i idx _ ___ st_img_path 1 9 st_mat_path 2 10 st_mat_test_path 3 11 st_matimg_path_root 4 12 st_profile_path 5 13
3. Merge Parameters Import
[param_map_ipwkbz_fibs, support_map_ipwkbz_fibs] = ffs_ipwkz_set_default_param(it_subset); % Remove Keys not Relevant for the Interest Rate Shock Model cl_st_ipwkbz_keysdrop = {'fl_r_borr', 'fl_r_save'}; remove(param_map_ipwkbz_fibs, cl_st_ipwkbz_keysdrop); % Merge param_map = [param_map_ipwkbz_fibs; param_map]; support_map = [support_map_ipwkbz_fibs; support_map];
Add on based on existing
% Percentage of w that is not for bridge loan, when param_map('bl_bridge') = false % ar_coh_bridge_perc = [1] param_map('it_coh_bridge_perc_n') = round(param_map('it_w_perc_n')/5);
Subset Options Adjustments
% close all close all; if (ismember(it_subset, [3])) % Profile run elseif (ismember(it_subset, [1,2,4])) % Main Run if (ismember(it_subset, [1])) param_map('it_coh_bridge_perc_n') = param_map('it_w_perc_n'); end if (ismember(it_subset, [4])) end end
Subset Options for Distribution solutions
if (ismember(it_subset, [7])) % Profile run elseif (ismember(it_subset, [5,6,8,9])) % Main Run if (it_subset == 5) param_map('it_coh_bridge_perc_n') = param_map('it_w_perc_n'); end if (ismember(it_subset, [8, 9])) if (ismember(it_subset, [9])) end end end
Display All Parameters
if (bl_display_defparam) disp('----------------------------------------'); disp('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); disp('Display All Parameters with IPWKBZR overriding IPWKBZR') disp('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'); fft_container_map_display(param_map); fft_container_map_display(support_map); end
---------------------------------------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Display All Parameters with IPWKBZR overriding IPWKBZR xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ---------------------------------------- ---------------------------------------- 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 = 1 ; key = bl_b_is_principle ; val = true pos = 2 ; key = bl_bridge ; val = true pos = 3 ; key = bl_default ; val = true pos = 4 ; key = bl_rollover ; val = true pos = 5 ; key = fl_Amean ; val = 1 pos = 6 ; key = fl_alpha ; val = 0.36 pos = 7 ; key = fl_b_bd ; val = -20 pos = 8 ; key = fl_beta ; val = 0.94 pos = 9 ; key = fl_c_min ; val = 0.02 pos = 10 ; key = fl_coh_interp_grid_gap ; val = 0.1 pos = 11 ; key = fl_crra ; val = 1.5 pos = 12 ; key = fl_default_wprime ; val = 0 pos = 13 ; key = fl_delta ; val = 0.08 pos = 14 ; key = fl_forbrblk_brleast ; val = -1 pos = 15 ; key = fl_forbrblk_brmost ; val = -19 pos = 16 ; key = fl_forbrblk_gap ; val = -1.5 pos = 17 ; key = fl_k_max ; val = 70 pos = 18 ; key = fl_k_min ; val = 0 pos = 19 ; key = fl_nan_replace ; val = -9999 pos = 20 ; key = fl_r_fbr ; val = 0.065 pos = 21 ; key = fl_r_fsv ; val = 0.025 pos = 22 ; key = fl_r_inf ; val = 0.095 pos = 23 ; key = fl_tol_dist ; val = 1e-05 pos = 24 ; key = fl_tol_pol ; val = 1e-05 pos = 25 ; key = fl_tol_val ; val = 1e-05 pos = 26 ; key = fl_w ; val = 0.44365 pos = 27 ; key = fl_w_interp_grid_gap ; val = 0.1 pos = 28 ; key = fl_w_max ; val = 50 pos = 29 ; key = fl_w_min ; val = -20 pos = 30 ; key = fl_z_mu ; val = 0 pos = 31 ; key = fl_z_rho ; val = 0.8 pos = 32 ; key = fl_z_sig ; val = 0.2 pos = 33 ; key = it_ak_perc_n ; val = 50 pos = 34 ; key = it_c_interp_grid_gap ; val = 0.0001 pos = 35 ; key = it_coh_bridge_perc_n ; val = 10 pos = 36 ; key = it_maxiter_dist ; val = 1000 pos = 37 ; key = it_maxiter_val ; val = 250 pos = 38 ; key = it_tol_pol_nochange ; val = 25 pos = 39 ; key = it_w_perc_n ; val = 50 pos = 40 ; key = it_z_n ; val = 15 pos = 41 ; key = st_analytical_stationary_type ; val = eigenvector pos = 42 ; key = st_forbrblk_type ; val = seg3 pos = 43 ; key = st_model ; val = ipwkbz_fibs ---------------------------------------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Scalars in Container and Sizes and Basic Statistics xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx i idx value __ ___ _______ bl_b_is_principle 1 1 1 bl_bridge 2 2 1 bl_default 3 3 1 bl_rollover 4 4 1 fl_Amean 5 5 1 fl_alpha 6 6 0.36 fl_b_bd 7 7 -20 fl_beta 8 8 0.94 fl_c_min 9 9 0.02 fl_coh_interp_grid_gap 10 10 0.1 fl_crra 11 11 1.5 fl_default_wprime 12 12 0 fl_delta 13 13 0.08 fl_forbrblk_brleast 14 14 -1 fl_forbrblk_brmost 15 15 -19 fl_forbrblk_gap 16 16 -1.5 fl_k_max 17 17 70 fl_k_min 18 18 0 fl_nan_replace 19 19 -9999 fl_r_fbr 20 20 0.065 fl_r_fsv 21 21 0.025 fl_r_inf 22 22 0.095 fl_tol_dist 23 23 1e-05 fl_tol_pol 24 24 1e-05 fl_tol_val 25 25 1e-05 fl_w 26 26 0.44365 fl_w_interp_grid_gap 27 27 0.1 fl_w_max 28 28 50 fl_w_min 29 29 -20 fl_z_mu 30 30 0 fl_z_rho 31 31 0.8 fl_z_sig 32 32 0.2 it_ak_perc_n 33 33 50 it_c_interp_grid_gap 34 34 0.0001 it_coh_bridge_perc_n 35 35 10 it_maxiter_dist 36 36 1000 it_maxiter_val 37 37 250 it_tol_pol_nochange 38 38 25 it_w_perc_n 39 39 50 it_z_n 40 40 15 ---------------------------------------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Strings in Container and Sizes and Basic Statistics xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx i idx _ ___ st_analytical_stationary_type 1 41 st_forbrblk_type 2 42 st_model 3 43 ---------------------------------------- ---------------------------------------- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Begin: Show all key and value pairs from container CONTAINER NAME: SUPPORT_MAP ---------------------------------------- Map with properties: Count: 48 KeyType: char ValueType: any xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ---------------------------------------- ---------------------------------------- pos = 1 ; key = bl_display ; val = false pos = 2 ; key = bl_display_defparam ; val = true pos = 3 ; key = bl_display_dist ; val = false pos = 4 ; key = bl_display_evf ; val = false pos = 5 ; key = bl_display_final ; val = true pos = 6 ; key = bl_display_final_dist ; val = false pos = 7 ; key = bl_display_final_dist_detail ; val = false pos = 8 ; key = bl_display_funcgrids ; val = false pos = 9 ; key = bl_display_infbridge ; val = false pos = 10 ; key = bl_display_minccost ; val = false pos = 11 ; key = bl_graph ; val = true pos = 12 ; key = bl_graph_coh_t_coh ; val = true pos = 13 ; key = bl_graph_evf ; val = false pos = 14 ; key = bl_graph_forinf_discrete ; val = true pos = 15 ; key = bl_graph_forinf_pol_lvl ; val = true pos = 16 ; key = bl_graph_forinf_pol_pct ; val = true pos = 17 ; key = bl_graph_funcgrids ; val = false pos = 18 ; key = bl_graph_funcgrids_detail ; val = false pos = 19 ; key = bl_graph_onebyones ; val = true pos = 20 ; key = bl_graph_pol_lvl ; val = true pos = 21 ; key = bl_graph_pol_pct ; val = true pos = 22 ; key = bl_graph_val ; val = true pos = 23 ; key = bl_img_save ; val = false pos = 24 ; key = bl_mat ; val = false pos = 25 ; key = bl_post ; val = true pos = 26 ; key = bl_profile ; val = false pos = 27 ; key = bl_profile_dist ; val = false pos = 28 ; key = bl_time ; val = false pos = 29 ; key = it_display_every ; val = 5 pos = 30 ; key = it_display_final_colmax ; val = 12 pos = 31 ; key = it_display_final_rowmax ; val = 100 pos = 32 ; key = it_display_summmat_colmax ; val = 7 pos = 33 ; key = it_display_summmat_rowmax ; val = 7 pos = 34 ; key = st_img_name_main ; val = _default pos = 35 ; key = st_img_path ; val = C:/Users/fan/CodeDynaAsset//m_fibs//m_ipwkbz_solve/img/ pos = 36 ; key = st_img_prefix ; val = pos = 37 ; key = st_img_suffix ; val = _p4.png pos = 38 ; key = st_mat_name_main ; val = _default pos = 39 ; key = st_mat_path ; val = C:/Users/fan/CodeDynaAsset//m_fibs//m_ipwkbz_solve/mat/ pos = 40 ; key = st_mat_prefix ; val = pos = 41 ; key = st_mat_suffix ; val = _p4 pos = 42 ; key = st_mat_test_path ; val = C:/Users/fan/CodeDynaAsset//m_fibs//test/ff_ipwkbz_ds_vecsv/mat/ pos = 43 ; key = st_matimg_path_root ; val = C:/Users/fan/CodeDynaAsset//m_fibs/ pos = 44 ; key = st_profile_name_main ; val = _default pos = 45 ; key = st_profile_path ; val = C:/Users/fan/CodeDynaAsset//m_fibs//m_ipwkbz_solve/profile/ pos = 46 ; key = st_profile_prefix ; val = pos = 47 ; key = st_profile_suffix ; val = _p4 pos = 48 ; 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 1 bl_display_dist 3 3 0 bl_display_evf 4 4 0 bl_display_final 5 5 1 bl_display_final_dist 6 6 0 bl_display_final_dist_detail 7 7 0 bl_display_funcgrids 8 8 0 bl_display_infbridge 9 9 0 bl_display_minccost 10 10 0 bl_graph 11 11 1 bl_graph_coh_t_coh 12 12 1 bl_graph_evf 13 13 0 bl_graph_forinf_discrete 14 14 1 bl_graph_forinf_pol_lvl 15 15 1 bl_graph_forinf_pol_pct 16 16 1 bl_graph_funcgrids 17 17 0 bl_graph_funcgrids_detail 18 18 0 bl_graph_onebyones 19 19 1 bl_graph_pol_lvl 20 20 1 bl_graph_pol_pct 21 21 1 bl_graph_val 22 22 1 bl_img_save 23 23 0 bl_mat 24 24 0 bl_post 25 25 1 bl_profile 26 26 0 bl_profile_dist 27 27 0 bl_time 28 28 0 it_display_every 29 29 5 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 Strings in Container and Sizes and Basic Statistics xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx i idx __ ___ st_img_name_main 1 34 st_img_path 2 35 st_img_prefix 3 36 st_img_suffix 4 37 st_mat_name_main 5 38 st_mat_path 6 39 st_mat_prefix 7 40 st_mat_suffix 8 41 st_mat_test_path 9 42 st_matimg_path_root 10 43 st_profile_name_main 11 44 st_profile_path 12 45 st_profile_prefix 13 46 st_profile_suffix 14 47 st_title_prefix 15 48
end
ans = Map with properties: Count: 43 KeyType: char ValueType: any