This is a static copy of a profile report

Home

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

Home

ffs_ipwkbz_fibs_set_default_param (Calls: 1, Time: 0.042 s)
Generated 15-Jul-2019 20:45:31 using performance time.
function in file C:\Users\fan\CodeDynaAsset\m_fibs\m_ipwkbz_paramfunc\ffs_ipwkbz_fibs_set_default_param.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
ff_ipwkbz_fibs_vf_vecsvfunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
90
[param_map_ipwkbz_fibs, suppor...
10.034 s82.0%
109
close all;
10.001 s3.2%
67
[st_root_path] = preamble(fals...
10.001 s2.8%
20
[it_subset, bl_display_defpara...
10.000 s0.7%
104
param_map('it_coh_bridge_perc_...
10.000 s0.6%
All other lines  0.004 s10.7%
Totals  0.042 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
ffs_ipwkbz_set_default_paramfunction10.034 s80.5%
closefunction10.001 s2.9%
preamblefunction10.001 s2.0%
ismemberfunction30.000 s0.1%
Self time (built-ins, overhead, etc.)  0.006 s14.5%
Totals  0.042 s100% 
Code Analyzer results
Line numberMessage
111Use of brackets [] is unnecessary. Use parentheses to group, if needed.
115Use of brackets [] is unnecessary. Use parentheses to group, if needed.
118Use of brackets [] is unnecessary. Use parentheses to group, if needed.
124Use of brackets [] is unnecessary. Use parentheses to group, if needed.
128IF might not be aligned with its matching END (line 130).
132Use of brackets [] is unnecessary. Use parentheses to group, if needed.
Coverage results
Show coverage for parent directory
Total lines in function146
Non-code lines (comments, blank lines)65
Code lines (lines that can run)81
Code lines that did run50
Code lines that did not run31
Coverage (did run/can run)61.73 %
Function listing
time 
Calls 
 line
   7 
function [param_map, support_map] = ffs_ipwkbz_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; 
      1 
  13
if (isempty(varargin)) 
  14 
    bl_display_defparam = true;
< 0.001 
      1 
  15
else 
      1 
  16
    bl_display_defparam = false; 
      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 
%% 1. 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') = 'ipwkbz_fibs'; 
  28 

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

  37 
%% 3. Set Interest Rates non-Shock Parameters
  38 

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

  51 
%% Setting support_map container
  52 

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

  55 
% Additional Controls
< 0.001 
      1 
  56
support_map('bl_display_minccost') = false; 
< 0.001 
      1 
  57
support_map('bl_display_infbridge') = false; 
< 0.001 
      1 
  58
support_map('bl_graph_funcgrids') = false; 
< 0.001 
      1 
  59
support_map('bl_graph_funcgrids_detail') = false; 
< 0.001 
      1 
  60
support_map('bl_display_funcgrids') = false; 
  61 

< 0.001 
      1 
  62
support_map('bl_graph_forinf_discrete') = true; 
< 0.001 
      1 
  63
support_map('bl_graph_forinf_pol_lvl') = true; 
< 0.001 
      1 
  64
support_map('bl_graph_forinf_pol_pct') = true; 
  65 

  66 
% root directory
  0.001 
      1 
  67
[st_root_path] = preamble(false); 
< 0.001 
      1 
  68
st_matimg_path_root = [st_root_path '/m_fibs/']; 
< 0.001 
      1 
  69
support_map('st_matimg_path_root') = st_matimg_path_root; 
< 0.001 
      1 
  70
support_map('st_profile_path') = [st_matimg_path_root '/m_ipwkbz_solve/profile/']; 
< 0.001 
      1 
  71
support_map('st_mat_path') = [st_matimg_path_root '/m_ipwkbz_solve/mat/']; 
< 0.001 
      1 
  72
support_map('st_img_path') = [st_matimg_path_root '/m_ipwkbz_solve/img/']; 
  73 

  74 
%% Display New Parameters
  75 

      1 
  76
if (bl_display_defparam) 
  77 

  78 
    disp('----------------------------------------');
  79 
    disp('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
  80 
    disp('Display Parameters Specific to IPWKBZ_FIBS')
  81 
    disp('it_coh_bridge_perc_n ADDED ON NEXT')
  82 
    disp('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
  83 

  84 
    fft_container_map_display(param_map);
  85 
    fft_container_map_display(support_map);
  86 
end
  87 

  88 
%% 3. Merge Parameters Import
  89 

  0.034 
      1 
  90
[param_map_ipwkbz_fibs, support_map_ipwkbz_fibs] = ffs_ipwkbz_set_default_param(it_subset); 
  91 

  92 
% Remove Keys not Relevant for the Interest Rate Shock Model
< 0.001 
      1 
  93
cl_st_ipwkbz_keysdrop = {'fl_r_borr', 'fl_r_save'}; 
< 0.001 
      1 
  94
remove(param_map_ipwkbz_fibs, cl_st_ipwkbz_keysdrop); 
  95 

  96 
% Merge
< 0.001 
      1 
  97
param_map = [param_map_ipwkbz_fibs; param_map]; 
< 0.001 
      1 
  98
support_map = [support_map_ipwkbz_fibs; support_map]; 
  99 

 100 
%% Add on based on existing
 101 

 102 
% Percentage of w that is not for bridge loan, when param_map('bl_bridge') = false
 103 
% ar_coh_bridge_perc = [1]
< 0.001 
      1 
 104
param_map('it_coh_bridge_perc_n') = round(param_map('it_w_perc_n')/5); 
 105 

 106 
%% Subset Options Adjustments
 107 

 108 
% close all
  0.001 
      1 
 109
close all; 
 110 

< 0.001 
      1 
 111
if (ismember(it_subset, [3])) 
 112 
    % Profile run
 113 
elseif (ismember(it_subset, [1,2,4]))
 114 
    % Main Run
 115 
    if (ismember(it_subset, [1]))
 116 
        param_map('it_coh_bridge_perc_n') = param_map('it_w_perc_n');
 117 
    end
 118 
    if (ismember(it_subset, [4]))
 119 
    end
 120 
end
 121 

 122 
%% Subset Options for Distribution solutions
 123 

< 0.001 
      1 
 124
if (ismember(it_subset, [7])) 
 125 
    % Profile run
< 0.001 
      1 
 126
elseif (ismember(it_subset, [5,6,8,9])) 
 127 
    % Main Run
 128 
        if (it_subset == 5)
 129 
        param_map('it_coh_bridge_perc_n') = param_map('it_w_perc_n');
 130 
    end
 131 
    if (ismember(it_subset, [8, 9]))
 132 
        if (ismember(it_subset, [9]))
 133 
        end
 134 

 135 
    end
 136 

 137 
end
 138 

 139 
%% Display All Parameters
 140 

      1 
 141
if (bl_display_defparam) 
 142 

 143 
    disp('----------------------------------------');
 144 
    disp('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
 145 
    disp('Display All Parameters with IPWKBZR overriding IPWKBZR')
 146 
    disp('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
 147 

 148 
    fft_container_map_display(param_map);
 149 
    fft_container_map_display(support_map);
 150 
end
 151 

< 0.001 
      1 
 152
end 

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