This is a static copy of a profile report

Home

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

Home

ff_wkz_vf_vecsv (Calls: 1, Time: 0.938 s)
Generated 03-Jul-2019 19:51:38 using performance time.
function in file C:\Users\fan\CodeDynaAsset\m_akz\solve\ff_wkz_vf_vecsv.m
Copy to new window for comparing multiple runs

Parents (calling functions)
No parent
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
222
mt_utility_update = f_util_crr...
15150.106 s11.3%
269
[~, ar_opti_fullakvec_idx_z] =...
150.094 s10.0%
189
ff_wkz_evf(mt_val_cur, param_m...
1010.093 s10.0%
252
[ar_opti_val1_z, ar_opti_idx_z...
15150.093 s9.9%
279
ar_pol_diff_norm(it_iter) = no...
1010.090 s9.6%
All other lines  0.462 s49.2%
Totals  0.938 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
...c)(((c).^(1-fl_crra)-1)./(1-fl_crra))anonymous function30300.100 s10.7%
ff_wkz_evffunction1010.090 s9.6%
...coh,bprime,kprime)(coh-kprime-bprime)anonymous function15150.030 s3.2%
meanfunction1010.008 s0.9%
Self time (built-ins, overhead, etc.)  0.709 s75.6%
Totals  0.938 s100% 
Code Analyzer results
Line numberMessage
112The value assigned here to 'f_coh' appears to be unused. Consider replacing it by ~.
116The value assigned here to 'fl_r_save' appears to be unused. Consider replacing it by ~.
116The value assigned here to 'fl_r_borr' appears to be unused. Consider replacing it by ~.
116The value assigned here to 'fl_wage' appears to be unused. Consider replacing it by ~.
Coverage results
Show coverage for parent directory
Total lines in function354
Non-code lines (comments, blank lines)193
Code lines (lines that can run)161
Code lines that did run67
Code lines that did not run94
Coverage (did run/can run)41.61 %
Function listing
time 
Calls 
 line
   7 
function result_map = ff_wkz_vf_vecsv(varargin)
   8 
%% FF_WKZ_VF_VECSV solve infinite horizon exo shock + endo asset problem
   9 
% This program solves the infinite horizon dynamic savings and risky
  10 
% capital asset problem with some ar1 shock. This is the efficient vectorized version
  11 
% of
  12 
% <https://fanwangecon.github.io/CodeDynaAsset/m_akz/solve/html/ff_wkz_vf.html
  13 
% ff_wkz_vf>. See that file for more descriptions. 
  14 
%
  15 
% @param param_map container parameter container
  16 
%
  17 
% @param support_map container support container
  18 
%
  19 
% @param armt_map container container with states, choices and shocks
  20 
% grids that are inputs for grid based solution algorithm
  21 
%
  22 
% @param func_map container container with function handles for
  23 
% consumption cash-on-hand etc.
  24 
%
  25 
% @return result_map container contains policy function matrix, value
  26 
% function matrix, iteration results, and policy function, value function
  27 
% and iteration results tables. 
  28 
%
  29 
% keys included in result_map:
  30 
%
  31 
% * mt_val matrix states_n by shock_n matrix of converged value function grid
  32 
% * mt_pol_a matrix states_n by shock_n matrix of converged policy function grid
  33 
% * ar_val_diff_norm array if bl_post = true it_iter_last by 1 val function
  34 
% difference between iteration
  35 
% * ar_pol_diff_norm array if bl_post = true it_iter_last by 1 policy
  36 
% function difference between iterations
  37 
% * mt_pol_perc_change matrix if bl_post = true it_iter_last by shock_n the
  38 
% proportion of grid points at which policy function changed between
  39 
% current and last iteration for each element of shock
  40 
%
  41 
% @include
  42 
%
  43 
% * <https://fanwangecon.github.io/CodeDynaAsset/m_akz/solve/html/ff_wkz_evf.html ff_wkz_evf>
  44 
% * <https://fanwangecon.github.io/CodeDynaAsset/m_akz/paramfunc/html/ffs_akz_set_default_param.html ffs_akz_set_default_param>
  45 
% * <https://fanwangecon.github.io/CodeDynaAsset/m_akz/paramfunc/html/ffs_akz_get_funcgrid.html ffs_akz_get_funcgrid>
  46 
% * <https://fanwangecon.github.io/CodeDynaAsset/m_akz/solvepost/html/ff_akz_vf_post.html ff_akz_vf_post>
  47 
%
  48 
% @seealso
  49 
%
  50 
% * concurrent (safe + risky) loop: <https://fanwangecon.github.io/CodeDynaAsset/m_akz/solve/html/ff_akz_vf.html ff_akz_vf>
  51 
% * concurrent (safe + risky) vectorized: <https://fanwangecon.github.io/CodeDynaAsset/m_akz/solve/html/ff_akz_vf_vec.html ff_akz_vf_vec>
  52 
% * concurrent (safe + risky) optimized-vectorized: <https://fanwangecon.github.io/CodeDynaAsset/m_akz/solve/html/ff_akz_vf_vecsv.html ff_akz_vf_vecsv>
  53 
% * two-stage (safe + risky) loop: <https://fanwangecon.github.io/CodeDynaAsset/m_akz/solve/html/ff_wkz_vf.html ff_wkz_vf>
  54 
% * two-stage (safe + risky) vectorized: <https://fanwangecon.github.io/CodeDynaAsset/m_akz/solve/html/ff_wkz_vf_vec.html ff_wkz_vf_vec>
  55 
% * two-stage (safe + risky) optimized-vectorized: <https://fanwangecon.github.io/CodeDynaAsset/m_akz/solve/html/ff_wkz_vf_vecsv.html ff_wkz_vf_vecsv>
  56 
% * two-stage + interpolate (safe + risky) loop: <https://fanwangecon.github.io/CodeDynaAsset/m_akz/solve/html/ff_iwkz_vf.html ff_iwkz_vf>
  57 
% * two-stage + interpolate (safe + risky) vectorized: <https://fanwangecon.github.io/CodeDynaAsset/m_akz/solve/html/ff_iwkz_vf_vec.html ff_iwkz_vf_vec>
  58 
% * two-stage + interpolate (safe + risky) optimized-vectorized: <https://fanwangecon.github.io/CodeDynaAsset/m_akz/solve/html/ff_iwkz_vf_vecsv.html ff_iwkz_vf_vecsv>
  59 
%
  60 

  61 
%% Default
  62 
% * it_param_set = 1: quick test
  63 
% * it_param_set = 2: benchmark run
  64 
% * it_param_set = 3: benchmark profile
  65 
% * it_param_set = 4: press publish button
  66 

  67 
it_param_set = 3;
  68 
bl_input_override = true;
  69 
[param_map, support_map] = ffs_akz_set_default_param(it_param_set);
  70 

  71 
% Note: param_map and support_map can be adjusted here or outside to override defaults
  72 
% param_map('it_w_n') = 50;
  73 
% param_map('it_z_n') = 15;
  74 

  75 
% get armt and func map
  76 
[armt_map, func_map] = ffs_akz_get_funcgrid(param_map, support_map, bl_input_override); % 1 for override
  77 
default_params = {param_map support_map armt_map func_map};
  78 

  79 
%% Parse Parameters 1
  80 

  81 
% if varargin only has param_map and support_map,
  82 
params_len = length(varargin);
  83 
[default_params{1:params_len}] = varargin{:};
  84 
param_map = [param_map; default_params{1}];
  85 
support_map = [support_map; default_params{2}];
  86 
if params_len >= 1 && params_len <= 2
  87 
    % If override param_map, re-generate armt and func if they are not
  88 
    % provided
  89 
    bl_input_override = true;
  90 
    [armt_map, func_map] = ffs_akz_get_funcgrid(param_map, support_map, bl_input_override);
  91 
else
  92 
    % Override all
  93 
    armt_map = [armt_map; default_params{3}];
  94 
    func_map = [func_map; default_params{4}];
  95 
end
  96 

  97 
% append function name
  98 
st_func_name = 'ff_wkz_vf_vecsv';
  99 
support_map('st_profile_name_main') = [st_func_name support_map('st_profile_name_main')];
 100 
support_map('st_mat_name_main') = [st_func_name support_map('st_mat_name_main')];
 101 
support_map('st_img_name_main') = [st_func_name support_map('st_img_name_main')];
 102 

 103 
%% Parse Parameters 2
 104 

 105 
% armt_map
 106 
params_group = values(armt_map, {'ar_w', 'ar_z'});
 107 
[ar_w, ar_z] = params_group{:};
 108 
params_group = values(armt_map, {'ar_a_meshk', 'ar_k_mesha', 'mt_coh_wkb', 'it_ameshk_n'});
 109 
[ar_a_meshk, ar_k_mesha, mt_coh_wkb, it_ameshk_n] = params_group{:};
 110 
% func_map
 111 
params_group = values(func_map, {'f_util_log', 'f_util_crra', 'f_cons', 'f_coh'});
 112 
[f_util_log, f_util_crra, f_cons, f_coh] = params_group{:};
 113 
% param_map
 114 
params_group = values(param_map, {'fl_r_save', 'fl_r_borr', 'fl_w',...
 115 
    'it_z_n', 'fl_crra', 'fl_beta', 'fl_c_min'});
 116 
[fl_r_save, fl_r_borr, fl_wage, it_z_n, fl_crra, fl_beta, fl_c_min] = params_group{:};
 117 
params_group = values(param_map, {'it_maxiter_val', 'fl_tol_val', 'fl_tol_pol', 'it_tol_pol_nochange'});
 118 
[it_maxiter_val, fl_tol_val, fl_tol_pol, it_tol_pol_nochange] = params_group{:};
 119 
% support_map
 120 
params_group = values(support_map, {'bl_profile', 'st_profile_path', ...
 121 
    'st_profile_prefix', 'st_profile_name_main', 'st_profile_suffix',...
 122 
    'bl_time', 'bl_display', 'it_display_every', 'bl_post'});
 123 
[bl_profile, st_profile_path, ...
 124 
    st_profile_prefix, st_profile_name_main, st_profile_suffix, ...
 125 
    bl_time, bl_display, it_display_every, bl_post] = params_group{:};
 126 

 127 
%% Initialize Output Matrixes
 128 

 129 
mt_val_cur = zeros(length(ar_a_meshk),length(ar_z));
 130 
mt_val = mt_val_cur - 1;
 131 
mt_pol_a = zeros(length(ar_a_meshk),length(ar_z));
 132 
mt_pol_a_cur = mt_pol_a - 1;
 133 
mt_pol_k = zeros(length(ar_a_meshk),length(ar_z));
 134 
mt_pol_k_cur = mt_pol_k - 1;
 135 
mt_pol_idx = zeros(length(ar_a_meshk),length(ar_z));
 136 
mt_ev_condi_z_max_kp = zeros(length(ar_w),length(ar_z));
 137 
mt_ev_condi_z_max_kp_cur = mt_ev_condi_z_max_kp - 1;
 138 

 139 
% We did not need these in ff_oz_vf or ff_oz_vf_vec
 140 
% see
 141 
% <https://fanwangecon.github.io/M4Econ/support/speed/partupdate/fs_u_c_partrepeat_main.html
 142 
% fs_u_c_partrepeat_main> for why store using cells.
 143 
cl_u_c_store = cell([it_z_n, 1]);
 144 
cl_c_valid_idx = cell([it_z_n, 1]);
 145 

 146 
%% Initialize Convergence Conditions
 147 

 148 
bl_vfi_continue = true;
 149 
it_iter = 0;
 150 
ar_val_diff_norm = zeros([it_maxiter_val, 1]);
 151 
ar_pol_diff_norm = zeros([it_maxiter_val, 1]);
 152 
mt_pol_perc_change = zeros([it_maxiter_val, it_z_n]);
 153 

 154 
%% Iterate Value Function
 155 
% Loop solution with 4 nested loops
 156 
%
 157 
% # loop 1: over exogenous states
 158 
% # loop 2: over endogenous states
 159 
% # loop 3: over choices
 160 
% # loop 4: add future utility, integration--loop over future shocks
 161 
%
 162 

 163 
% Start Profile
 164 
if (bl_profile)
 165 
    close all;
 166 
    profile off;
 167 
    profile on;
< 0.001 
      1 
 168
end 
 169 

 170 
% Start Timer
< 0.001 
      1 
 171
if (bl_time) 
< 0.001 
      1 
 172
    tic; 
< 0.001 
      1 
 173
end 
 174 

 175 
% Value Function Iteration
< 0.001 
      1 
 176
while bl_vfi_continue 
< 0.001 
    101 
 177
    it_iter = it_iter + 1; 
 178 
    
 179 
    %% Solve Second Stage Problem k*(w,z)
 180 
    % This is the key difference between this function and
 181 
    % <https://fanwangecon.github.io/CodeDynaAsset/m_akz/paramfunc/html/ffs_akz_set_functions.html
 182 
    % ffs_akz_set_functions> which solves the two stages jointly
 183 
    % Across iterations, only some k*(w,z) is changing, we only update
 184 
    % consumption matrix when k*(w,z) is changing
 185 
    % note in ff_wkz_evf a = b
 186 
    
< 0.001 
    101 
 187
    bl_input_override = true; 
  0.093 
    101 
 188
    [mt_ev_condi_z_max, ~, mt_ev_condi_z_max_kp, mt_ev_condi_z_max_bp] = ... 
    101 
 189
        ff_wkz_evf(mt_val_cur, param_map, support_map, armt_map, bl_input_override); 
 190 
    
 191 
    %% Find which k choice differ across iterations?
 192 
    
< 0.001 
    101 
 193
    mt_w_kstar_diff_idx = (mt_ev_condi_z_max_kp_cur ~= mt_ev_condi_z_max_kp); 
 194 
    
 195 
    %% Solve First Stage Problem w*(z) given k*(w,z)
 196 
        
 197 
    % loop 1: over exogenous states
< 0.001 
    101 
 198
    for it_z_i = 1:length(ar_z) 
 199 

 200 
        % State Array fixed
  0.004 
   1515 
 201
        ar_coh_z = mt_coh_wkb(:,it_z_i); 
 202 
        
 203 
        % Get 2nd Stage Choice Arrays
 204 
        % Update rows where opti k given w=k'+b' is changing
< 0.001 
   1515 
 205
        ar_w_kstar_diff_idx = mt_w_kstar_diff_idx(:, it_z_i); 
  0.006 
   1515 
 206
        ar_w_kstar_z = mt_ev_condi_z_max_kp(ar_w_kstar_diff_idx, it_z_i); 
  0.005 
   1515 
 207
        ar_w_astar_z = mt_ev_condi_z_max_bp(ar_w_kstar_diff_idx, it_z_i);         
 208 
        
 209 
        % Consumption Update
 210 
        % Note that compared to
 211 
        % <https://fanwangecon.github.io/CodeDynaAsset/m_akz/paramfunc/html/ffs_akz_set_functions.html
 212 
        % ffs_akz_set_functions> the mt_c here is much smaller the same
 213 
        % number of columns (states) as in the ffs_akz_set_functions file,
 214 
        % but the number of rows equal to ar_w length.            
  0.046 
   1515 
 215
        mt_c = f_cons(ar_coh_z', ar_w_astar_z, ar_w_kstar_z); 
 216 
                
 217 
        % EVAL current utility: N by N, f_util defined earlier
< 0.001 
   1515 
 218
        if (fl_crra == 1) 
 219 
            mt_utility_update = f_util_log(mt_c);
 220 
            fl_u_neg_c = f_util_log(fl_c_min);            
< 0.001 
   1515 
 221
        else 
  0.106 
   1515 
 222
            mt_utility_update = f_util_crra(mt_c); 
  0.011 
   1515 
 223
            fl_u_neg_c = f_util_crra(fl_c_min);             
< 0.001 
   1515 
 224
        end 
 225 
        
 226 
        % Eliminate Complex Numbers
  0.005 
   1515 
 227
        mt_it_c_valid_idx = (mt_c <= fl_c_min); 
  0.023 
   1515 
 228
        mt_utility_update(mt_it_c_valid_idx) = fl_u_neg_c;         
 229 
        
 230 
        % Update Storage
< 0.001 
   1515 
 231
        if (it_iter == 1) 
< 0.001 
     15 
 232
            cl_u_c_store{it_z_i} = mt_utility_update; 
< 0.001 
     15 
 233
            cl_c_valid_idx{it_z_i} = mt_it_c_valid_idx; 
< 0.001 
   1500 
 234
        else 
  0.014 
   1500 
 235
            cl_u_c_store{it_z_i}(ar_w_kstar_diff_idx,:) = mt_utility_update;                 
  0.010 
   1500 
 236
            cl_c_valid_idx{it_z_i}(ar_w_kstar_diff_idx,:) = mt_it_c_valid_idx;  
< 0.001 
   1515 
 237
        end 
 238 
                
 239 
        % EVAL add on future utility, N by N + N by 1
  0.001 
   1515 
 240
        ar_evzp_ak_condi_z = mt_ev_condi_z_max(:, it_z_i); 
  0.077 
   1515 
 241
        mt_utility = cl_u_c_store{it_z_i} + fl_beta*ar_evzp_ak_condi_z; 
 242 
        
 243 
        % Index update
 244 
        % using the method below is much faster than index replace
 245 
        % see <https://fanwangecon.github.io/M4Econ/support/speed/index/fs_subscript.html fs_subscript>
  0.004 
   1515 
 246
        mt_it_c_valid_idx = cl_c_valid_idx{it_z_i};         
  0.084 
   1515 
 247
        mt_utility = mt_utility.*(~mt_it_c_valid_idx) + fl_u_neg_c*(mt_it_c_valid_idx); 
 248 
        
 249 
        % Optimization: remember matlab is column major, rows must be
 250 
        % choices, columns must be states
 251 
        % <https://en.wikipedia.org/wiki/Row-_and_column-major_order COLUMN-MAJOR>
  0.093 
   1515 
 252
        [ar_opti_val1_z, ar_opti_idx_z] = max(mt_utility); 
  0.013 
   1515 
 253
        mt_val(:,it_z_i) = ar_opti_val1_z; 
  0.024 
   1515 
 254
        mt_pol_a(:,it_z_i) = mt_ev_condi_z_max_bp(ar_opti_idx_z, it_z_i); 
  0.021 
   1515 
 255
        mt_pol_k(:,it_z_i) = mt_ev_condi_z_max_kp(ar_opti_idx_z, it_z_i);         
 256 
        
 257 
        %% Obtain Choice Index for Vectorized/Analytical Distribution Programs
 258 
        % For deriving distributions using vectorized and semi-analytical
 259 
        % methods, at convergence, what index do optimal choices correspond
 260 
        % to in terms of the rows of mt_val and mt_pol_a, and mt_pol_k. For
 261 
        % the LHS matrixes here, each column a different optimal choice,
 262 
        % each row a different element of the a_meshk and k_mesha vectors.
 263 
        % For each column (one optimal choice), which row has that optimal
 264 
        % choice's k' and b' values. Note the code is shorter than code in
 265 
        % <https://fanwangecon.github.io/CodeDynaAsset/m_akz/solve/html/ff_wkz_vf_vec.html
 266 
        % ff_wkz_vf_vec>.
 267 
        
  0.001 
   1515 
 268
        if (it_iter == (it_maxiter_val + 1))            
  0.094 
     15 
 269
            [~, ar_opti_fullakvec_idx_z] = max((ar_a_meshk == mt_pol_a(:,it_z_i)').*(ar_k_mesha == mt_pol_k(:,it_z_i)')); 
< 0.001 
     15 
 270
            mt_pol_idx(:,it_z_i) = ar_opti_fullakvec_idx_z; 
< 0.001 
     15 
 271
        end 
 272 

  0.003 
   1515 
 273
    end 
 274 
    
 275 
    %% Check Tolerance and Continuation
 276 
    
 277 
    % Difference across iterations
  0.059 
    101 
 278
    ar_val_diff_norm(it_iter) = norm(mt_val - mt_val_cur); 
  0.090 
    101 
 279
    ar_pol_diff_norm(it_iter) = norm(mt_pol_a - mt_pol_a_cur) + norm(mt_pol_k - mt_pol_k_cur); 
  0.008 
    101 
 280
    ar_pol_a_perc_change = sum((mt_pol_a ~= mt_pol_a_cur))/(it_ameshk_n); 
  0.007 
    101 
 281
    ar_pol_k_perc_change = sum((mt_pol_k ~= mt_pol_k_cur))/(it_ameshk_n);     
  0.011 
    101 
 282
    mt_pol_perc_change(it_iter, :) = mean([ar_pol_a_perc_change;ar_pol_k_perc_change]); 
 283 
    
 284 
    % Update
  0.004 
    101 
 285
    mt_val_cur = mt_val; 
  0.002 
    101 
 286
    mt_pol_a_cur = mt_pol_a; 
  0.002 
    101 
 287
    mt_pol_k_cur = mt_pol_k; 
< 0.001 
    101 
 288
    mt_ev_condi_z_max_kp_cur = mt_ev_condi_z_max_kp; 
 289 
    
 290 
    % Print Iteration Results
< 0.001 
    101 
 291
    if (bl_display && (rem(it_iter, it_display_every)==0)) 
 292 
        fprintf('VAL it_iter:%d, fl_diff:%d, fl_diff_pol:%d\n', ...
 293 
            it_iter, ar_val_diff_norm(it_iter), ar_pol_diff_norm(it_iter));
 294 
        tb_valpol_iter = array2table([mean(mt_val_cur,1);...
 295 
                                      mean(mt_pol_a_cur,1); ...
 296 
                                      mean(mt_pol_k_cur,1); ...
 297 
                                      mt_val_cur(it_ameshk_n,:); ...
 298 
                                      mt_pol_a_cur(it_ameshk_n,:); ...
 299 
                                      mt_pol_k_cur(it_ameshk_n,:)]);
 300 
        tb_valpol_iter.Properties.VariableNames = strcat('z', string((1:size(mt_val_cur,2))));
 301 
        tb_valpol_iter.Properties.RowNames = {'mval', 'map', 'mak', 'Hval', 'Hap', 'Hak'};
 302 
        disp('mval = mean(mt_val_cur,1), average value over a')
 303 
        disp('map  = mean(mt_pol_a_cur,1), average choice over a')
 304 
        disp('mkp  = mean(mt_pol_k_cur,1), average choice over k')
 305 
        disp('Hval = mt_val_cur(it_ameshk_n,:), highest a state val')
 306 
        disp('Hap = mt_pol_a_cur(it_ameshk_n,:), highest a state choice')
 307 
        disp('mak = mt_pol_k_cur(it_ameshk_n,:), highest k state choice')                
 308 
        disp(tb_valpol_iter);
 309 
    end
 310 
    
 311 
    % Continuation Conditions:
 312 
    % 1. if value function convergence criteria reached
 313 
    % 2. if policy function variation over iterations is less than
 314 
    % threshold
< 0.001 
    101 
 315
    if (it_iter == (it_maxiter_val + 1)) 
< 0.001 
      1 
 316
        bl_vfi_continue = false; 
  0.001 
    100 
 317
    elseif ((it_iter == it_maxiter_val) || ... 
    100 
 318
            (ar_val_diff_norm(it_iter) < fl_tol_val) || ... 
    100 
 319
            (sum(ar_pol_diff_norm(max(1, it_iter-it_tol_pol_nochange):it_iter)) < fl_tol_pol)) 
 320 
        % Fix to max, run again to save results if needed
< 0.001 
      1 
 321
        it_iter_last = it_iter; 
< 0.001 
      1 
 322
        it_iter = it_maxiter_val;         
< 0.001 
      1 
 323
    end 
 324 
    
< 0.001 
    101 
 325
end 
 326 

 327 
% End Timer
< 0.001 
      1 
 328
if (bl_time) 
< 0.001 
      1 
 329
    toc; 
< 0.001 
      1 
 330
end 
 331 

 332 
% End Profile
< 0.001 
      1 
 333
if (bl_profile) 
  0.007 
      1 
 334
    profile off 
 335 
    profile viewer
 336 
    st_file_name = [st_profile_prefix st_profile_name_main st_profile_suffix];
 337 
    profsave(profile('info'), strcat(st_profile_path, st_file_name));
 338 
end
 339 

 340 
%% Process Optimal Choices
 341 

 342 
result_map = containers.Map('KeyType','char', 'ValueType','any');
 343 
result_map('mt_val') = mt_val;
 344 
result_map('mt_pol_idx') = mt_pol_idx;
 345 

 346 
result_map('cl_mt_pol_coh') = {mt_coh_wkb, zeros(1)};
 347 
result_map('cl_mt_pol_a') = {mt_pol_a, zeros(1)};
 348 
result_map('cl_mt_pol_k') = {mt_pol_k, zeros(1)};
 349 
result_map('cl_mt_pol_c') = {f_cons(mt_coh_wkb, mt_pol_a, mt_pol_k), zeros(1)};
 350 
result_map('ar_st_pol_names') = ["cl_mt_pol_coh", "cl_mt_pol_a", "cl_mt_pol_k", "cl_mt_pol_c"];
 351 

 352 
if (bl_post)
 353 
    bl_input_override = true;
 354 
    result_map('ar_val_diff_norm') = ar_val_diff_norm(1:it_iter_last);
 355 
    result_map('ar_pol_diff_norm') = ar_pol_diff_norm(1:it_iter_last);
 356 
    result_map('mt_pol_perc_change') = mt_pol_perc_change(1:it_iter_last, :);
 357 
    result_map = ff_akz_vf_post(param_map, support_map, armt_map, func_map, result_map, bl_input_override);
 358 
end
 359 

 360 
end

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