Test Preference (Risky + Safe Asets + Two-Step + Interpolated Distribution)

back to Fan's Dynamic Assets Repository Table of Content.

@include

@seealso

Contents

Set Shared Parameters

close all;
clear all;

ar_fl_beta = [0.87, 0.925, 0.97];
ar_fl_crra = [1, 1.5, 2.0];
it_z_n = 15;

Simulate Model with Discount = 0.87

for fl_crra = ar_fl_crra

    disp('xxxxxxxxxxxxxxxxxxxxxxxxxxx');
    disp('xxxxxxxxxxxxxxxxxxxxxxxxxxx');
    disp(['fl_beta = ' num2str(ar_fl_beta(1))]);
    disp(['fl_crra = ' num2str(fl_crra)]);
    disp('xxxxxxxxxxxxxxxxxxxxxxxxxxx');
    disp('xxxxxxxxxxxxxxxxxxxxxxxxxxx');
    disp('');
    disp('');
    disp('');
    disp('');

    % Call Default Parameters <https://fanwangecon.github.io/CodeDynaAsset/m_akz/paramfunc/html/ffs_akz_set_default_param.html ffs_akz_set_default_param>
    bl_input_override = true;
    it_param_set = 9;
    [param_map, support_map] = ffs_akz_set_default_param(it_param_set);

    % Simulation Accuracy
    param_map('it_z_n') = it_z_n;
    param_map('fl_beta') = ar_fl_beta(1);
    param_map('fl_crra') = fl_crra;

    % Display Parameters
    support_map('bl_display') = false;
    support_map('bl_display_final') = false;
    support_map('bl_time') = true;
    support_map('bl_profile') = false;
    support_map('bl_graph_coh_t_coh') = true;

    % Call Grid Generator <https://fanwangecon.github.io/CodeDynaAsset/m_az/paramfunc/html/ffs_akz_get_funcgrid.html ffs_akz_get_funcgrid>
    [armt_map, func_map] = ffs_akz_get_funcgrid(param_map, support_map, bl_input_override);

    % Call Dynamic Programming Problem <https://fanwangecon.github.io/CodeDynaAsset/m_az/solve/html/ff_iwkz_vf_vecsv.html ff_iwkz_vf_vecsv>
    result_map = ff_iwkz_vf_vecsv(param_map, support_map, armt_map, func_map);

    % Call Distribution CProgram
    result_map = ff_iwkz_ds_vec(param_map, support_map, armt_map, func_map, result_map, bl_input_override);

    % Snap
    snapnow;

end

% close all
close all;
xxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx
fl_beta = 0.87
fl_crra = 1
xxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx
Elapsed time is 1.681968 seconds.
Elapsed time is 0.527236 seconds.
                      mean          sd        coefofvar      min        max       pYis0      pYls0      pYgr0       pYisMINY    pYisMAXY     p0_1        p1         p5        p10       p15       p20       p25       p35       p50       p65       p75       p80       p85       p90       p95       p99      p99_9     fl_cov_cl_mt_coh    fl_cor_cl_mt_coh    fl_cov_cl_mt_pol_a    fl_cor_cl_mt_pol_a    fl_cov_cl_mt_pol_k    fl_cor_cl_mt_pol_k    fl_cov_cl_mt_pol_c    fl_cor_cl_mt_pol_c    fracByP0_1    fracByP1     fracByP5    fracByP10    fracByP15    fracByP20    fracByP25    fracByP35    fracByP50    fracByP65    fracByP75    fracByP80    fracByP85    fracByP90    fracByP95    fracByP99    fracByP99_9
                   __________    _________    _________    ________    ______    ________    _____    __________    ________    ________    _______    _______    _______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ________________    ________________    __________________    __________________    __________________    __________________    __________________    __________________    __________    _________    ________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    ___________

    cl_mt_coh          3.5606       1.2842     0.36067      0.44365    57.277           0      0               1    0.010563       0        0.44365    0.44365     2.0474    2.0474    2.2479    2.4484    3.0498    3.2502    3.5509    3.7514    3.9519    4.1524    4.4531     4.854    6.1571    8.1618    10.968          1.6492                   1             0.0002524             0.024339                 1.0761                0.962                0.57285              0.88239         0.0013162     0.0013162    0.059476    0.059476     0.084578      0.12688      0.16978      0.27956       0.4916      0.60147      0.68853      0.74534      0.78462      0.82608      0.90265      0.97553       0.99685  
    cl_mt_pol_a    5.4757e-05    0.0080751      147.47            0    44.898     0.99995      0      4.9218e-05     0.99995       0              0          0          0         0         0         0         0         0         0         0         0         0         0         0         0         0         0       0.0002524            0.024339            6.5207e-05                    1             0.00013719             0.019505             4.9996e-05             0.012248                 0             0           0           0            0            0            0            0            0            0            0            0            0            0            0            0             0  
    cl_mt_pol_k        1.9974      0.87104     0.43609            0    21.429    0.010563      0         0.98944    0.010563       0              0          0     1.0204    1.0204    1.0204    1.0204    2.0408    2.0408    2.0408    2.0408    2.0408    2.0408    2.0408    3.0612    4.0816     5.102    7.1429          1.0761               0.962            0.00013719             0.019505                0.75872                    1                0.31725              0.72047                 0             0     0.11811     0.11811      0.11811      0.11811      0.76371      0.76371      0.76371      0.76371      0.76371      0.76371      0.76371      0.87022      0.95178      0.97877       0.99744  
    cl_mt_pol_c        1.5632      0.50552     0.32339     0.024653    12.598           0      0               1           0       0        0.44365    0.44365    0.92677     1.027    1.1092    1.2094    1.2094    1.3097    1.5101    1.7106    1.9111    1.9111    2.1115    2.1757    2.4764    3.2241    3.8436         0.57285             0.88239            4.9996e-05             0.012248                0.31725              0.72047                0.25555                    1          0.002998      0.002998     0.02764    0.085118       0.1171      0.17635      0.17635      0.29477      0.46054      0.60107      0.73034      0.73034      0.82932      0.84006      0.92268       0.9789       0.99778  

xxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx
fl_beta = 0.87
fl_crra = 1.5
xxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx
Elapsed time is 0.675843 seconds.
Elapsed time is 0.639874 seconds.
                      mean         sd       coefofvar      min       max       pYis0      pYls0      pYgr0       pYisMINY     pYisMAXY      p0_1        p1         p5       p10       p15       p20       p25       p35       p50       p65       p75       p80       p85       p90       p95       p99      p99_9     fl_cov_cl_mt_coh    fl_cor_cl_mt_coh    fl_cov_cl_mt_pol_a    fl_cor_cl_mt_pol_a    fl_cov_cl_mt_pol_k    fl_cor_cl_mt_pol_k    fl_cov_cl_mt_pol_c    fl_cor_cl_mt_pol_c    fracByP0_1    fracByP1     fracByP5    fracByP10    fracByP15    fracByP20    fracByP25    fracByP35    fracByP50    fracByP65    fracByP75    fracByP80    fracByP85    fracByP90    fracByP95    fracByP99    fracByP99_9
                   __________    _______    _________    _______    ______    ________    _____    __________    ________    __________    _______    _______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ________________    ________________    __________________    __________________    __________________    __________________    __________________    __________________    __________    _________    ________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    ___________

    cl_mt_coh          3.7968     1.4444     0.38042     0.44365    57.277           0      0               1    0.012324             0    0.44365    0.44365    2.0474    2.2479    2.4484    2.9495      3.15    3.2502    3.5509    3.9519    4.1524    4.4531     4.854    5.4554     6.558    8.8634    12.271          2.0862                   1             0.0030316             0.068951                1.4593               0.96792                0.62392              0.85513           0.00144       0.00144    0.037794    0.055326     0.088641      0.11661      0.18075      0.24528       0.4238      0.57952      0.63045      0.69194      0.76486      0.82004      0.89676      0.97393       0.99677  
    cl_mt_pol_a    0.00054336    0.03044      56.023           0    46.939     0.99961      0      0.00038734     0.99961             0          0          0         0         0         0         0         0         0         0         0         0         0         0         0         0         0         0       0.0030316            0.068951            0.00092661                    1             0.0015575              0.049018             0.00054752             0.035607                 0             0           0           0            0            0            0            0            0            0            0            0            0            0            0            0             0  
    cl_mt_pol_k        2.2119     1.0438     0.47191           0    21.429    0.012324      0         0.98768    0.012324    4.7988e-84          0          0    1.0204    1.0204    1.0204    2.0408    2.0408    2.0408    2.0408    2.0408    2.0408    3.0612    3.0612    3.0612    4.0816    6.1224    8.1633          1.4593             0.96792             0.0015575             0.049018                1.0895                     1                 0.3682               0.6983                 0             0      0.0828      0.0828       0.0828      0.61739      0.61739      0.61739      0.61739      0.61739      0.61739      0.81864      0.81864      0.81864      0.90044      0.98279       0.99611  
    cl_mt_pol_c        1.5844    0.50515     0.31883     0.12489    10.238           0      0               1           0             0    0.44365    0.44365     1.009     1.027    1.1092    1.2094    1.2275    1.3097    1.5101    1.7106    1.9111    1.9111    2.1115    2.1937    2.4764    3.1419    3.8255         0.62392             0.85513            0.00054752             0.035607                0.3682                0.6983                0.25518                    1         0.0034509     0.0034509    0.041506    0.070247      0.10477      0.16231      0.18526      0.27535      0.43551      0.58046      0.71881      0.71881      0.82175      0.83342       0.9121      0.98039       0.99755  

xxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx
fl_beta = 0.87
fl_crra = 2
xxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx
Elapsed time is 0.703762 seconds.
Elapsed time is 0.620137 seconds.
                     mean          sd       coefofvar      min       max       pYis0      pYls0      pYgr0      pYisMINY     pYisMAXY      p0_1        p1         p5       p10       p15       p20       p25       p35       p50       p65       p75       p80       p85       p90       p95       p99      p99_9     fl_cov_cl_mt_coh    fl_cor_cl_mt_coh    fl_cov_cl_mt_pol_a    fl_cor_cl_mt_pol_a    fl_cov_cl_mt_pol_k    fl_cor_cl_mt_pol_k    fl_cov_cl_mt_pol_c    fl_cor_cl_mt_pol_c    fracByP0_1    fracByP1     fracByP5    fracByP10    fracByP15    fracByP20    fracByP25    fracByP35    fracByP50    fracByP65    fracByP75    fracByP80    fracByP85    fracByP90    fracByP95    fracByP99    fracByP99_9
                   _________    ________    _________    _______    ______    ________    _____    _________    ________    __________    _______    _______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ________________    ________________    __________________    __________________    __________________    __________________    __________________    __________________    __________    _________    ________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    ___________

    cl_mt_coh         3.8703      1.6201      0.4186     0.44365    57.277           0      0              1    0.012324             0    0.44365    0.44365    2.0474    2.2479    2.4484    2.9495      3.15    3.2502    3.5509    3.9519    4.3528    4.6535     4.854    5.7561    7.0592    10.267    13.675          2.6247                  1              0.020214               0.15225                1.9156              0.97327                0.68888               0.84078         0.0014127     0.0014127    0.036918    0.054041     0.086578      0.11387      0.17629      0.23905      0.41268      0.56421      0.62812      0.70256      0.74153      0.82058      0.89161      0.97059       0.99642  
    cl_mt_pol_a    0.0032865    0.081951      24.935           0    47.959     0.99787      0      0.0021279     0.99787             0          0          0         0         0         0         0         0         0         0         0         0         0         0         0         0         0    1.0204        0.020214            0.15225              0.006716                     1              0.010025              0.10069              0.0034738              0.083817                 0             0           0           0            0            0            0            0            0            0            0            0            0            0            0            0       0.43327  
    cl_mt_pol_k       2.2771      1.2149     0.53352           0    21.429    0.012324      0        0.98768    0.012324    7.0739e-09          0          0    1.0204    1.0204    1.0204    2.0408    2.0408    2.0408    2.0408    2.0408    2.0408    3.0612    3.0612    3.0612     5.102    7.1429    10.204          1.9156            0.97327              0.010025               0.10069                 1.476                    1                0.42965               0.69929                 0             0     0.08007     0.08007      0.08007        0.595        0.595        0.595        0.595        0.595        0.595      0.78436      0.78436      0.78436        0.916      0.97141       0.99782  
    cl_mt_pol_c       1.5899     0.50573     0.31809     0.12489    8.8168           0      0              1           0             0    0.44365    0.44365     1.009     1.027    1.1092    1.2094    1.2275    1.3097    1.5101    1.7106    1.9111    1.9111    2.1115    2.2579    2.4944    3.1239    3.9899         0.68888            0.84078             0.0034738              0.083817               0.42965              0.69929                0.25576                     1          0.003439      0.003439    0.041126    0.069641      0.10376      0.16061      0.18337      0.27212      0.42999      0.57118      0.70994      0.70994      0.81503      0.83604      0.91468      0.97885       0.99787  

Simulate Model with Discount = 0.925

close all

for fl_crra = ar_fl_crra

    disp('xxxxxxxxxxxxxxxxxxxxxxxxxxx');
    disp('xxxxxxxxxxxxxxxxxxxxxxxxxxx');
    disp(['fl_beta = ' num2str(ar_fl_beta(2))]);
    disp(['fl_crra = ' num2str(fl_crra)]);
    disp('xxxxxxxxxxxxxxxxxxxxxxxxxxx');
    disp('xxxxxxxxxxxxxxxxxxxxxxxxxxx');
    disp('');
    disp('');
    disp('');
    disp('');

    % Call Default Parameters <https://fanwangecon.github.io/CodeDynaAsset/m_akz/paramfunc/html/ffs_akz_set_default_param.html ffs_akz_set_default_param>
    bl_input_override = true;
    it_param_set = 9;
    [param_map, support_map] = ffs_akz_set_default_param(it_param_set);

    % Simulation Accuracy
    param_map('it_z_n') = it_z_n;
    param_map('fl_beta') = ar_fl_beta(2);
    param_map('fl_crra') = fl_crra;

    % Display Parameters
    support_map('bl_display') = false;
    support_map('bl_display_final') = false;
    support_map('bl_time') = true;
    support_map('bl_profile') = false;
    support_map('bl_graph_coh_t_coh') = true;

    % Call Grid Generator <https://fanwangecon.github.io/CodeDynaAsset/m_az/paramfunc/html/ffs_akz_get_funcgrid.html ffs_akz_get_funcgrid>
    [armt_map, func_map] = ffs_akz_get_funcgrid(param_map, support_map, bl_input_override);

    % Call Dynamic Programming Problem <https://fanwangecon.github.io/CodeDynaAsset/m_az/solve/html/ff_iwkz_vf_vecsv.html ff_iwkz_vf_vecsv>
    result_map = ff_iwkz_vf_vecsv(param_map, support_map, armt_map, func_map);

    % Call Distribution CProgram
    result_map = ff_iwkz_ds_vec(param_map, support_map, armt_map, func_map, result_map, bl_input_override);

    % Snap
    snapnow;

end

% close all
close all;
xxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx
fl_beta = 0.925
fl_crra = 1
xxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx
Elapsed time is 0.723453 seconds.
Elapsed time is 0.458693 seconds.
                     mean        sd       coefofvar      min        max       pYis0     pYls0     pYgr0      pYisMINY     pYisMAXY      p0_1        p1         p5       p10       p15       p20       p25       p35       p50       p65       p75       p80       p85       p90       p95       p99      p99_9     fl_cov_cl_mt_coh    fl_cor_cl_mt_coh    fl_cov_cl_mt_pol_a    fl_cor_cl_mt_pol_a    fl_cov_cl_mt_pol_k    fl_cor_cl_mt_pol_k    fl_cov_cl_mt_pol_c    fl_cor_cl_mt_pol_c    fracByP0_1    fracByP1     fracByP5    fracByP10    fracByP15    fracByP20    fracByP25    fracByP35    fracByP50    fracByP65    fracByP75    fracByP80    fracByP85    fracByP90    fracByP95    fracByP99    fracByP99_9
                   ________    _______    _________    ________    ______    _______    _____    ________    ________    __________    _______    _______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ________________    ________________    __________________    __________________    __________________    __________________    __________________    __________________    __________    _________    ________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    ___________

    cl_mt_coh        5.5176     2.1412     0.38806      0.44365    57.277          0      0             1          0              0     2.7491     2.9495      3.15    3.2502    3.5509    3.7514    4.1524    4.4531     4.854    5.7561     6.558     6.959    7.3599    8.4625    9.5651    13.174    17.183         4.5846                   1               0.10746               0.21978                3.4274               0.97864                1.0498              0.87368          0.0011697     0.0097301    0.036372    0.057253      0.10327       0.1211      0.18394      0.28646      0.38749      0.50971      0.61761      0.68169      0.74759      0.83319      0.89718      0.97711       0.99693  
    cl_mt_pol_a    0.020088    0.22836      11.368            0    47.959    0.98943      0      0.010574    0.98943              0          0          0         0         0         0         0         0         0         0         0         0         0         0         0         0    1.0204    3.0612        0.10746             0.21978              0.052149                     1              0.036253              0.097059              0.019062              0.14875                  0             0           0           0            0            0            0            0            0            0            0            0            0            0            0      0.14753       0.76824  
    cl_mt_pol_k      3.7407     1.6357     0.43726            0    21.429          0      0             1          0     1.7243e-07     2.0408     2.0408    2.0408    2.0408    2.0408    2.0408    3.0612    3.0612    3.0612    4.0816    4.0816     5.102     5.102    6.1224    7.1429    9.1837    13.265         3.4274             0.97864              0.036253              0.097059                2.6754                     1                0.7158              0.77985            0.12244       0.12244     0.12244     0.12244      0.12244      0.12244      0.41864      0.41864      0.41864      0.60123      0.60123      0.78044      0.78044      0.87881      0.92971      0.97319       0.99841  
    cl_mt_pol_c      1.7568    0.56117     0.31942     -0.57676    8.5161          0      0             1          0              0    0.70825    0.90872     1.009    1.1092    1.2094    1.2916    1.3097     1.474    1.6745     1.875    2.0935    2.1757      2.34    2.4764    2.8051    3.4065    4.1542         1.0498             0.87368              0.019062               0.14875                0.7158               0.77985               0.31491                    1          0.0009437     0.0090253    0.030421    0.075272     0.099679      0.14198      0.17071      0.25646      0.39535      0.54436      0.66054      0.70579      0.77924      0.83419      0.90953      0.97999        0.9976  

xxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx
fl_beta = 0.925
fl_crra = 1.5
xxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx
Elapsed time is 1.105647 seconds.
Elapsed time is 0.516114 seconds.
                     mean        sd       coefofvar      min        max       pYis0      pYls0     pYgr0      pYisMINY     pYisMAXY      p0_1        p1         p5       p10       p15       p20       p25       p35       p50       p65       p75       p80       p85       p90       p95       p99      p99_9     fl_cov_cl_mt_coh    fl_cor_cl_mt_coh    fl_cov_cl_mt_pol_a    fl_cor_cl_mt_pol_a    fl_cov_cl_mt_pol_k    fl_cor_cl_mt_pol_k    fl_cov_cl_mt_pol_c    fl_cor_cl_mt_pol_c    fracByP0_1     fracByP1     fracByP5    fracByP10    fracByP15    fracByP20    fracByP25    fracByP35    fracByP50    fracByP65    fracByP75    fracByP80    fracByP85    fracByP90    fracByP95    fracByP99    fracByP99_9
                   ________    _______    _________    ________    ______    ________    _____    ________    ________    __________    _______    _______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ________________    ________________    __________________    __________________    __________________    __________________    __________________    __________________    __________    __________    ________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    ___________

    cl_mt_coh        5.7834     2.5116     0.43428      0.44365    57.277           0      0             1    0.010563             0    0.44365    0.44365      3.15    3.2502    3.5509    3.7514    4.1524    4.4531     5.255    5.9566    6.8587    7.3599    8.1618    9.2644    10.367    14.276     19.99         6.3081                   1               0.48088              0.39309                4.6046               0.96713                 1.2227              0.86007          0.00081032    0.00081032    0.033673    0.052509     0.094015      0.11012      0.16233      0.23675      0.34496      0.49989        0.613      0.67586      0.73985       0.8245       0.8925      0.97192       0.99661  
    cl_mt_pol_a    0.075777    0.48707      6.4277            0    47.959     0.95958      0      0.040415     0.95958             0          0          0         0         0         0         0         0         0         0         0         0         0         0         0         0    2.0408    6.1224        0.48088             0.39309               0.23724                    1               0.17626                0.1909               0.067383              0.24442                   0             0           0           0            0            0            0            0            0            0            0            0            0            0            0      0.52344       0.89226  
    cl_mt_pol_k      3.9484     1.8956      0.4801            0    22.449    0.010563      0       0.98944    0.010563    1.7502e-06          0          0    2.0408    2.0408    2.0408    2.0408    3.0612    3.0612    3.0612    4.0816     5.102     5.102    6.1224    6.1224    7.1429    10.204    14.286         4.6046             0.96713               0.17626               0.1909                3.5934                     1                0.83492              0.77816                   0             0     0.10986     0.10986      0.10986      0.10986      0.32752      0.32752      0.32752      0.56332      0.71028      0.71028      0.80346      0.80346      0.89034      0.97313       0.99612  
    cl_mt_pol_c      1.7593      0.566     0.32173     0.024653    7.2772           0      0             1           0             0    0.44365    0.44365     1.009    1.1092    1.2094    1.2916    1.3097     1.474    1.6745     1.875    2.1035    2.1757    2.3581    2.5044    2.8232    3.3885    3.9177         1.2227             0.86007              0.067383              0.24442               0.83492               0.77816                0.32036                    1           0.0026638     0.0026638    0.030666        0.07     0.093048       0.1425      0.16962      0.25028      0.37969       0.5353      0.64367      0.70717      0.76896      0.84035      0.92458      0.98154       0.99777  

xxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx
fl_beta = 0.925
fl_crra = 2
xxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx
Elapsed time is 0.698005 seconds.
Elapsed time is 0.689429 seconds.
                    mean        sd       coefofvar      min       max       pYis0      pYls0     pYgr0      pYisMINY     pYisMAXY      p0_1        p1         p5       p10       p15       p20       p25       p35       p50       p65       p75       p80       p85       p90       p95       p99      p99_9     fl_cov_cl_mt_coh    fl_cor_cl_mt_coh    fl_cov_cl_mt_pol_a    fl_cor_cl_mt_pol_a    fl_cov_cl_mt_pol_k    fl_cor_cl_mt_pol_k    fl_cov_cl_mt_pol_c    fl_cor_cl_mt_pol_c    fracByP0_1     fracByP1     fracByP5    fracByP10    fracByP15    fracByP20    fracByP25    fracByP35    fracByP50    fracByP65    fracByP75    fracByP80    fracByP85    fracByP90    fracByP95    fracByP99    fracByP99_9
                   _______    _______    _________    _______    ______    ________    _____    ________    ________    __________    _______    _______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ________________    ________________    __________________    __________________    __________________    __________________    __________________    __________________    __________    __________    ________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    ___________

    cl_mt_coh       5.7707     2.9751     0.51556     0.44365    57.277           0      0             1    0.012324             0    0.44365    0.44365    3.0498    3.2502    3.3505    3.5509    3.7514    4.1524     4.854    5.9566    6.8587    7.3599    8.1618    9.5651     11.77    16.882    23.097         8.8515                   1               1.4984               0.57302                5.9839               0.94293                1.3692               0.83262          0.00094746    0.00094746    0.021279    0.063708     0.093359      0.12427      0.15104      0.21139      0.33294      0.49484      0.59442      0.65056      0.70689      0.78966      0.87142      0.96942       0.99569  
    cl_mt_pol_a    0.17956    0.87893      4.8948           0    47.959     0.93093      0      0.069074     0.93093             0          0          0         0         0         0         0         0         0         0         0         0         0         0         0    1.0204     5.102    10.204         1.4984             0.57302              0.77252                     1               0.54816               0.29238               0.17774               0.36587                   0             0           0           0            0            0            0            0            0            0            0            0            0            0       0.1802      0.67149       0.95144  
    cl_mt_pol_k     3.8456      2.133     0.55467           0    22.449    0.012324      0       0.98768    0.012324    1.1441e-07          0          0    2.0408    2.0408    2.0408    2.0408    2.0408    3.0612    3.0612    4.0816     5.102     5.102     5.102    6.1224    8.1633    11.224    15.306         5.9839             0.94293              0.54816               0.29238                4.5498                     1               0.88593               0.75145                   0             0     0.16228     0.16228      0.16228      0.16228      0.16228       0.3442       0.3442      0.55376      0.69409      0.69409      0.69409      0.78366      0.88768      0.96734       0.99643  
    cl_mt_pol_c     1.7455    0.55272     0.31665     0.12489    7.2772           0      0             1           0             0    0.44365    0.44365     1.009    1.1092    1.2094    1.2916    1.3097     1.474    1.6745     1.875    2.1115    2.1757      2.34    2.4764     2.759    3.2241    3.9376         1.3692             0.83262              0.17774               0.36587               0.88593               0.75145                0.3055                     1           0.0031323     0.0031323    0.031883    0.068354     0.098769      0.14038       0.1787        0.249      0.37741      0.52875      0.65832       0.7138      0.77434      0.83874      0.91343      0.97981       0.99762  

Simulate Model with Discount = 0.97

close all

for fl_crra = ar_fl_crra

    disp('xxxxxxxxxxxxxxxxxxxxxxxxxxx');
    disp('xxxxxxxxxxxxxxxxxxxxxxxxxxx');
    disp(['fl_beta = ' num2str(ar_fl_beta(3))]);
    disp(['fl_crra = ' num2str(fl_crra)]);
    disp('xxxxxxxxxxxxxxxxxxxxxxxxxxx');
    disp('xxxxxxxxxxxxxxxxxxxxxxxxxxx');
    disp('');
    disp('');
    disp('');
    disp('');

    % Call Default Parameters <https://fanwangecon.github.io/CodeDynaAsset/m_akz/paramfunc/html/ffs_akz_set_default_param.html ffs_akz_set_default_param>
    bl_input_override = true;
    it_param_set = 9;
    [param_map, support_map] = ffs_akz_set_default_param(it_param_set);

    % Simulation Accuracy
    param_map('it_z_n') = it_z_n;
    param_map('fl_beta') = ar_fl_beta(3);
    param_map('fl_crra') = fl_crra;

    % Display Parameters
    support_map('bl_display') = false;
    support_map('bl_display_final') = false;
    support_map('bl_time') = true;
    support_map('bl_profile') = false;
    support_map('bl_graph_coh_t_coh') = true;

    % Call Grid Generator <https://fanwangecon.github.io/CodeDynaAsset/m_az/paramfunc/html/ffs_akz_get_funcgrid.html ffs_akz_get_funcgrid>
    [armt_map, func_map] = ffs_akz_get_funcgrid(param_map, support_map, bl_input_override);

    % Call Dynamic Programming Problem <https://fanwangecon.github.io/CodeDynaAsset/m_az/solve/html/ff_iwkz_vf_vecsv.html ff_iwkz_vf_vecsv>
    result_map = ff_iwkz_vf_vecsv(param_map, support_map, armt_map, func_map);

    % Call Distribution CProgram
    result_map = ff_iwkz_ds_vec(param_map, support_map, armt_map, func_map, result_map, bl_input_override);

    % Snap
    snapnow;

end

% close all
close all;
clear all;
xxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx
fl_beta = 0.97
fl_crra = 1
xxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx
Elapsed time is 1.441120 seconds.
Elapsed time is 0.841439 seconds.
                    mean       sd       coefofvar      min        max       pYis0     pYls0     pYgr0     pYisMINY    pYisMAXY      p0_1        p1         p5       p10       p15       p20       p25       p35       p50       p65       p75       p80       p85       p90       p95       p99      p99_9     fl_cov_cl_mt_coh    fl_cor_cl_mt_coh    fl_cov_cl_mt_pol_a    fl_cor_cl_mt_pol_a    fl_cov_cl_mt_pol_k    fl_cor_cl_mt_pol_k    fl_cov_cl_mt_pol_c    fl_cor_cl_mt_pol_c    fracByP0_1    fracByP1     fracByP5    fracByP10    fracByP15    fracByP20    fracByP25    fracByP35    fracByP50    fracByP65    fracByP75    fracByP80    fracByP85    fracByP90    fracByP95    fracByP99    fracByP99_9
                   ______    _______    _________    ________    ______    _______    _____    _______    ________    _________    _______    _______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ________________    ________________    __________________    __________________    __________________    __________________    __________________    __________________    __________    _________    ________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    ___________

    cl_mt_coh      13.316     7.3232     0.54994      0.44365    57.277          0      0            1          0             0     3.8517     4.4531    5.3552    6.2573    6.8587    7.4601    7.8611    8.9637    11.069    14.176    16.882    18.586    20.691    23.598    28.008     37.23    48.657         53.629                   1                39.71               0.90819                10.793               0.52426                 3.126               0.79238           0.0003721    0.0038655    0.020149    0.045365     0.067749     0.098817      0.12964       0.1886      0.29979      0.43777      0.55461      0.62252      0.69546      0.78426      0.87533      0.96862       0.99625  
    cl_mt_pol_a    4.8221     5.9706      1.2382            0    47.959    0.28432      0      0.71568    0.28432             0          0          0         0         0         0         0         0    1.0204    2.0408     5.102    7.1429    8.1633    10.204    13.265    17.347     25.51    36.735          39.71             0.90819               35.649                     1                2.0578                0.1226                2.0036               0.62293                   0            0           0           0            0            0            0     0.016527     0.069083      0.20409        0.329      0.38926      0.49055      0.62699      0.77962      0.93936       0.99284  
    cl_mt_pol_k    6.4539     2.8113     0.43559            0    21.429          0      0            1          0     0.0013161     2.0408     3.0612    3.0612    4.0816    4.0816    4.0816    4.0816     5.102    6.1224    6.1224    7.1429    8.1633    9.1837    11.224    11.224    15.306    21.429         10.793             0.52426               2.0578                0.1226                7.9031                     1               0.83216               0.54948          0.00063176    0.0047996    0.028082     0.15413      0.15413      0.15413      0.15413      0.30703       0.4571      0.48795      0.59709      0.66044      0.78594      0.80563      0.89074      0.97827             1  
    cl_mt_pol_c    2.0403    0.53871     0.26403     -0.57676    7.2772          0      0            1          0             0    0.79043    0.97285    1.1733    1.3377     1.456    1.5382    1.6484    1.8028    2.0393    2.2398    2.4222    2.5044    2.5965    2.7248    2.9253    3.3823    3.8212          3.126             0.79238               2.0036               0.62293               0.83216               0.54948               0.29021                     1          0.00049569    0.0073142    0.029275    0.064168     0.091802      0.13041      0.16743      0.26038      0.40825      0.55263      0.67334      0.72736      0.79554      0.85827       0.9225      0.98288       0.99811  

xxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx
fl_beta = 0.97
fl_crra = 1.5
xxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx
Elapsed time is 1.825683 seconds.
Elapsed time is 1.184164 seconds.
                    mean       sd       coefofvar      min        max       pYis0      pYls0     pYgr0     pYisMINY    pYisMAXY      p0_1        p1         p5       p10       p15       p20       p25       p35       p50       p65       p75       p80       p85       p90       p95       p99      p99_9     fl_cov_cl_mt_coh    fl_cor_cl_mt_coh    fl_cov_cl_mt_pol_a    fl_cor_cl_mt_pol_a    fl_cov_cl_mt_pol_k    fl_cor_cl_mt_pol_k    fl_cov_cl_mt_pol_c    fl_cor_cl_mt_pol_c    fracByP0_1     fracByP1     fracByP5    fracByP10    fracByP15    fracByP20    fracByP25    fracByP35    fracByP50    fracByP65    fracByP75    fracByP80    fracByP85    fracByP90    fracByP95    fracByP99    fracByP99_9
                   ______    _______    _________    ________    ______    ________    _____    _______    ________    _________    _______    _______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ________________    ________________    __________________    __________________    __________________    __________________    __________________    __________________    __________    __________    ________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    ___________

    cl_mt_coh      16.248     9.6491     0.59385      0.44365    57.277           0      0            1    0.010563            0    0.44365    0.44365    5.5557    6.4578    7.1594    8.1618     8.663    10.567    13.775    17.885    21.493    23.598    26.304    30.113    35.927     45.65    53.468         93.105                   1                75.68               0.94382                13.061               0.45942                4.3638               0.79714          0.00028842    0.00028842    0.015315    0.032287     0.052481     0.080522      0.10274       0.1625      0.27487      0.41953      0.53918      0.60867       0.6869      0.77185      0.87279      0.96968       0.99682  
    cl_mt_pol_a    7.6413       8.31      1.0875            0    47.959      0.2098      0       0.7902      0.2098            0          0          0         0         0         0         0    1.0204    2.0408     5.102    8.1633    12.245    14.286    16.327    19.388     25.51    34.694    40.816          75.68             0.94382               69.057                     1                3.4806               0.14215                3.1426               0.66655                   0             0           0           0            0            0     0.006942     0.029993       0.1102      0.22337       0.3758      0.45467      0.53814      0.66001      0.80412       0.9601       0.99544  
    cl_mt_pol_k    6.5061     2.9464     0.45287            0    21.429    0.010563      0      0.98944    0.010563    0.0015054          0          0    3.0612    4.0816    4.0816    4.0816     5.102     5.102    6.1224    7.1429    8.1633    9.1837    9.1837    11.224    13.265    15.306    21.429         13.061             0.45942               3.4806               0.14215                8.6814                     1               0.89937               0.53802                   0             0    0.024489    0.049021      0.12283      0.12283      0.14177      0.29791      0.41479      0.49262       0.5916      0.77075      0.77075      0.87467      0.88781      0.97951             1  
    cl_mt_pol_c     2.101    0.56734     0.27003     0.024653    7.2772           0      0            1           0            0    0.44365    0.44365    1.1733    1.3838    1.5201    1.6023    1.7305     1.875    2.1035    2.3239    2.4863    2.5685    2.6607    2.7908    3.0174    3.4682    3.9694         4.3638             0.79714               3.1426               0.66655               0.89937               0.53802               0.32188                     1           0.0022306     0.0022306    0.022533    0.056792      0.09229      0.12513      0.16551       0.2521      0.39566       0.5538      0.66769      0.72728      0.79002      0.85265      0.92212      0.98239       0.99779  

xxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx
fl_beta = 0.97
fl_crra = 2
xxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx
Elapsed time is 1.865286 seconds.
Elapsed time is 0.961065 seconds.
                    mean       sd       coefofvar      min        max       pYis0      pYls0     pYgr0     pYisMINY     pYisMAXY      p0_1        p1         p5       p10       p15       p20       p25       p35       p50       p65       p75       p80       p85       p90       p95       p99      p99_9     fl_cov_cl_mt_coh    fl_cor_cl_mt_coh    fl_cov_cl_mt_pol_a    fl_cor_cl_mt_pol_a    fl_cov_cl_mt_pol_k    fl_cor_cl_mt_pol_k    fl_cov_cl_mt_pol_c    fl_cor_cl_mt_pol_c    fracByP0_1     fracByP1     fracByP5    fracByP10    fracByP15    fracByP20    fracByP25    fracByP35    fracByP50    fracByP65    fracByP75    fracByP80    fracByP85    fracByP90    fracByP95    fracByP99    fracByP99_9
                   ______    _______    _________    ________    ______    ________    _____    _______    ________    __________    _______    _______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ______    ________________    ________________    __________________    __________________    __________________    __________________    __________________    __________________    __________    __________    ________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    _________    ___________

    cl_mt_coh      18.667     11.369     0.60902      0.44365    57.277           0      0            1    0.010563             0    0.44365    0.44365    5.3552    6.6582    7.6606    8.5627    9.5651     11.87    15.679    21.092    25.703    28.409    31.517    35.727     41.34    50.361    54.571         129.25                   1                109.9               0.95893                14.014               0.41235                5.3413               0.80415          0.00025105    0.00025105     0.01062    0.028247     0.048747       0.06883     0.095322     0.14886      0.25896      0.40696      0.53234      0.60644      0.68674      0.77801      0.87481      0.97367       0.99787  
    cl_mt_pol_a    9.9845      10.08      1.0096            0    47.959     0.18346      0      0.81654     0.18346             0          0          0         0         0         0    1.0204    1.0204    3.0612    7.1429    11.224    16.327    18.367    21.429     25.51    30.612    38.776    42.857          109.9             0.95893               101.61                     1                4.1797               0.13871                4.1018               0.69648                   0             0           0           0            0     0.0046614    0.0070453    0.033088      0.11764      0.24314      0.38104      0.47198      0.58185       0.6922      0.83104      0.96249         0.996  
    cl_mt_pol_k    6.5221     2.9893     0.45833            0    22.449    0.010563      0      0.98944    0.010563    0.00058498          0          0    3.0612    3.0612    4.0816    4.0816     5.102     5.102    6.1224    7.1429    8.1633    9.1837    9.1837    11.224    13.265    15.306    21.429         14.014             0.41235               4.1797               0.13871                8.9357                     1               0.89808               0.51423                   0             0    0.025696    0.041144      0.12322       0.12322      0.15795     0.28211      0.39257      0.50256      0.60713      0.76366      0.76366      0.86824      0.94341      0.97794       0.99799  
    cl_mt_pol_c    2.1608    0.58424     0.27038     0.024653    7.2772           0      0            1           0             0    0.44365    0.44365    1.2374    1.4199    1.5382    1.6745    1.7766    1.9329    2.1595    2.3899    2.5505    2.6426    2.7367    2.8811    3.0915    3.5024    4.5708         5.3413             0.80415               4.1018               0.69648               0.89808               0.51423               0.34134                     1           0.0021688     0.0021688    0.024042    0.056005     0.088291       0.12685      0.16658     0.25118      0.39355      0.55157      0.66909      0.73254      0.78997      0.85788      0.92242      0.98184       0.99797