This is a static copy of a profile report

Home

Function details for ffs_ipwkbzr_fibs_set_default_paramThis is a static copy of a profile report

Home

ffs_ipwkbzr_fibs_set_default_param (Calls: 1, Time: 0.041 s)
Generated 15-Jul-2019 21:24:51 using performance time.
function in file C:\Users\fan\CodeDynaAsset\m_fibs\m_ipwkbzr_paramfunc\ffs_ipwkbzr_fibs_set_default_param.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
ff_ipwkbzr_fibs_vf_vecsvfunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
120
[param_map_ipwkbzr_fibs, suppo...
10.036 s89.0%
140
close all;
10.001 s3.0%
97
[st_root_path] = preamble(fals...
10.001 s2.7%
79
param_map('it_z_n') = param_ma...
10.000 s0.3%
135
param_map('it_coh_bridge_perc_...
10.000 s0.2%
All other lines  0.002 s4.8%
Totals  0.041 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
ffs_ipwkbz_set_default_paramfunction10.036 s88.1%
closefunction10.001 s2.8%
preamblefunction10.001 s2.1%
ismemberfunction60.000 s0.2%
Self time (built-ins, overhead, etc.)  0.003 s6.8%
Totals  0.041 s100% 
Code Analyzer results
Line numberMessage
142Use of brackets [] is unnecessary. Use parentheses to group, if needed.
146Use of brackets [] is unnecessary. Use parentheses to group, if needed.
156Use of brackets [] is unnecessary. Use parentheses to group, if needed.
162Use of brackets [] is unnecessary. Use parentheses to group, if needed.
177Use of brackets [] is unnecessary. Use parentheses to group, if needed.
Coverage results
Show coverage for parent directory
Total lines in function190
Non-code lines (comments, blank lines)90
Code lines (lines that can run)100
Code lines that did run65
Code lines that did not run35
Coverage (did run/can run)65.00 %
Function listing
time 
Calls 
 line
   7 
function [param_map, support_map] = ffs_ipwkbzr_fibs_set_default_param(varargin)
   8 
%% FFS_IPWKBZ_FIBS_SET_DEFAULT_PARAM setting model default parameters
   9 

  10 
%% Default
  11 

< 0.001 
      1 
  12
it_subset = 4; 
< 0.001 
      1 
  13
if (isempty(varargin)) 
  14 
    bl_display_defparam = true;
< 0.001 
      1 
  15
else 
< 0.001 
      1 
  16
    bl_display_defparam = false; 
< 0.001 
      1 
  17
end 
< 0.001 
      1 
  18
default_params = {it_subset bl_display_defparam}; 
< 0.001 
      1 
  19
[default_params{1:length(varargin)}] = varargin{:}; 
< 0.001 
      1 
  20
[it_subset, bl_display_defparam] = default_params{:}; 
  21 

  22 
%% 1a. Initiate Param_map
  23 

< 0.001 
      1 
  24
param_map = containers.Map('KeyType','char', 'ValueType','any'); 
  25 

  26 
% model name
< 0.001 
      1 
  27
param_map('st_model') = 'ipwkbzr_fibs'; 
  28 

  29 
% v(coh, z) interpolation method
< 0.001 
      1 
  30
param_map('st_v_coh_z_interp_method') = 'method_cell'; 
  31 

  32 
%% 2a. Set Borrowing Control Parameters
  33 
% Borrowing Setting 1: Default Allowed, Bridge True, bl_rollover does not matter
  34 
% Borrowing Setting 2: Default Allowed, Bridge False, bl_rollover matter
< 0.001 
      1 
  35
param_map('bl_default') = true; % if borrowing is default allowed 
< 0.001 
      1 
  36
param_map('bl_bridge') = true; 
< 0.001 
      1 
  37
param_map('bl_rollover') = true; 
< 0.001 
      1 
  38
param_map('bl_b_is_principle') = true; 
  39 

  40 
%% 3. Set Interest Rates non-Shock Parameters
  41 

  42 
% formal informal parameters
  43 
% fl_for_br_block are the formal borrowing grid block sizes.
< 0.001 
      1 
  44
param_map('fl_r_fsv') = 0.025; 
< 0.001 
      1 
  45
param_map('fl_r_fbr') = 0.065; 
  46 
% see: ffs_for_br_block.m
< 0.001 
      1 
  47
param_map('st_forbrblk_type') = 'unif'; 
< 0.001 
      1 
  48
param_map('fl_forbrblk_brmost') = -19; 
< 0.001 
      1 
  49
param_map('fl_forbrblk_brleast') = -1; 
< 0.001 
      1 
  50
param_map('fl_forbrblk_gap') = -1.5; 
  51 

  52 
%% 3a. Set Shock 1 Borrowing Interest Rate Parameters
  53 
% See
  54 
% <https://fanwangecon.github.io/CodeDynaAsset/tools/html/fft_gen_discrete_var.html
  55 
% fft_gen_discrete_var> for how these parameters will be used to generate a
  56 
% discrete random variable for the interest rate.
  57 

< 0.001 
      1 
  58
param_map('st_z_r_infbr_drv_ele_type') = 'unif'; 
< 0.001 
      1 
  59
param_map('st_z_r_infbr_drv_prb_type') = 'poiss'; 
< 0.001 
      1 
  60
param_map('fl_z_r_infbr_poiss_mean') = 20; 
< 0.001 
      1 
  61
param_map('fl_z_r_infbr_max') = 0.095; 
< 0.001 
      1 
  62
param_map('fl_z_r_infbr_min') = 0.025; 
< 0.001 
      1 
  63
param_map('fl_z_r_infbr_n') = 5; 
  64 
% param_map('fl_z_r_infbr_max') = 0.095;
  65 
% param_map('fl_z_r_infbr_min') = 0.095;
  66 
% param_map('fl_z_r_infbr_n') = 1;
  67 

  68 
%% 3b. Set Shock 2 Productivity Shock Parameters
  69 

  70 
% Production Function
  71 
% Productivity Shock Parameters
< 0.001 
      1 
  72
param_map('it_z_wage_n') = 15; 
< 0.001 
      1 
  73
param_map('fl_z_wage_mu') = 0; 
< 0.001 
      1 
  74
param_map('fl_z_wage_rho') = 0.8; 
< 0.001 
      1 
  75
param_map('fl_z_wage_sig') = 0.2; 
  76 

  77 
%% 3c. Set Overall Shock Grid Count
  78 

< 0.001 
      1 
  79
param_map('it_z_n') = param_map('it_z_wage_n') * param_map('fl_z_r_infbr_n'); 
  80 

  81 
%% Setting support_map container
  82 

< 0.001 
      1 
  83
support_map = containers.Map('KeyType','char', 'ValueType','any'); 
  84 

  85 
% Additional Controls
< 0.001 
      1 
  86
support_map('bl_display_minccost') = false; 
< 0.001 
      1 
  87
support_map('bl_display_infbridge') = false; 
< 0.001 
      1 
  88
support_map('bl_graph_funcgrids') = false; 
< 0.001 
      1 
  89
support_map('bl_graph_funcgrids_detail') = false; 
< 0.001 
      1 
  90
support_map('bl_display_funcgrids') = false; 
  91 

< 0.001 
      1 
  92
support_map('bl_graph_forinf_discrete') = true; 
< 0.001 
      1 
  93
support_map('bl_graph_forinf_pol_lvl') = true; 
< 0.001 
      1 
  94
support_map('bl_graph_forinf_pol_pct') = true; 
  95 

  96 
% root directory
  0.001 
      1 
  97
[st_root_path] = preamble(false); 
< 0.001 
      1 
  98
st_matimg_path_root = [st_root_path '/m_fibs/']; 
< 0.001 
      1 
  99
support_map('st_matimg_path_root') = st_matimg_path_root; 
< 0.001 
      1 
 100
support_map('st_profile_path') = [st_matimg_path_root '/m_ipwkbzr_solve/profile/']; 
< 0.001 
      1 
 101
support_map('st_mat_path') = [st_matimg_path_root '/m_ipwkbzr_solve/mat/']; 
< 0.001 
      1 
 102
support_map('st_img_path') = [st_matimg_path_root '/m_ipwkbzr_solve/img/']; 
 103 

 104 
%% Display New Parameters
 105 

< 0.001 
      1 
 106
if (bl_display_defparam) 
 107 
    
 108 
    disp('----------------------------------------');
 109 
    disp('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
 110 
    disp('Display Parameters Specific to IPWKBZR_FIBS')
 111 
    disp('it_coh_bridge_perc_n ADDED ON NEXT')
 112 
    disp('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
 113 
    
 114 
    fft_container_map_display(param_map);
 115 
    fft_container_map_display(support_map);
 116 
end
 117 

 118 
%% 3. Merge Parameters Import
 119 

  0.036 
      1 
 120
[param_map_ipwkbzr_fibs, support_map_ipwkbzr_fibs] = ffs_ipwkbz_set_default_param(it_subset); 
 121 

 122 
% Remove Keys not Relevant for the Interest Rate Shock Model
< 0.001 
      1 
 123
cl_st_ipwkbzr_keysdrop = {'fl_z_rho', 'fl_z_mu', 'fl_z_sig', ... 
 124 
    'fl_r_borr', 'fl_r_save'};
< 0.001 
      1 
 125
remove(param_map_ipwkbzr_fibs, cl_st_ipwkbzr_keysdrop); 
 126 

 127 
% Merge
< 0.001 
      1 
 128
param_map = [param_map_ipwkbzr_fibs; param_map]; 
< 0.001 
      1 
 129
support_map = [support_map_ipwkbzr_fibs; support_map]; 
 130 

 131 
%% Add on based on existing
 132 

 133 
% Percentage of w that is not for bridge loan, when param_map('bl_bridge') = false
 134 
% ar_coh_bridge_perc = [1]
< 0.001 
      1 
 135
param_map('it_coh_bridge_perc_n') = round(param_map('it_w_perc_n')/5); 
 136 

 137 
%% Subset Options Adjustments
 138 

 139 
% close all
  0.001 
      1 
 140
close all; 
 141 

< 0.001 
      1 
 142
if (ismember(it_subset, [3])) 
 143 
    % Profile run
< 0.001 
      1 
 144
elseif (ismember(it_subset, [1,2,4])) 
 145 
    % Main Run
< 0.001 
      1 
 146
    if (ismember(it_subset, [1])) 
 147 
        
 148 
        param_map('it_z_wage_n') = 5;
 149 
        param_map('fl_z_r_infbr_n') = 3;
 150 
        param_map('it_z_n') = param_map('it_z_wage_n') * param_map('fl_z_r_infbr_n');
 151 
        
 152 
        param_map('it_coh_bridge_perc_n') = param_map('it_w_perc_n');
 153 
        
 154 
        support_map('bl_graph') = true;
 155 
    end
< 0.001 
      1 
 156
    if (ismember(it_subset, [4])) 
< 0.001 
      1 
 157
    end 
< 0.001 
      1 
 158
end 
 159 

 160 
%% Subset Options for Distribution solutions
 161 

< 0.001 
      1 
 162
if (ismember(it_subset, [7])) 
 163 
    % Profile run
< 0.001 
      1 
 164
elseif (ismember(it_subset, [5,6,8,9])) 
 165 
    % Main Run
 166 
    if (it_subset == 5)
 167 
        
 168 
        param_map('it_z_wage_n') = 5;
 169 
        param_map('fl_z_r_infbr_n') = 3;
 170 
        param_map('it_z_n') = param_map('it_z_wage_n') * param_map('fl_z_r_infbr_n');
 171 
        
 172 
        param_map('it_coh_bridge_perc_n') = param_map('it_w_perc_n');
 173 
        
 174 
        support_map('bl_graph') = true;
 175 
    end
 176 
    if (ismember(it_subset, [8, 9]))
 177 
        if (ismember(it_subset, [9]))
 178 
            support_map('bl_timer') = true;
 179 
        end
 180 
    end
 181 
end
 182 

 183 
%% Display All Parameters
 184 

< 0.001 
      1 
 185
if (bl_display_defparam) 
 186 
    
 187 
    disp('----------------------------------------');
 188 
    disp('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
 189 
    disp('Display All Parameters with IPWKBZR overriding IPWKBZR')
 190 
    disp('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
 191 
    
 192 
    fft_container_map_display(param_map);
 193 
    fft_container_map_display(support_map);
 194 
end
 195 

< 0.001 
      1 
 196
end 

Other subfunctions in this file are not included in this listing.