1 FF_DS_AZ_CTS_LOOP Dynamic Savings Loop Continuous Distribution

Go to the MLX, M, PDF, or HTML version of this file. Go back to fan’s MEconTools Toolbox (bookdown), Matlab Code Examples Repository (bookdown), or Math for Econ with Matlab Repository (bookdown).

Examples](https://fanwangecon.github.io/M4Econ/), or** Dynamic Asset This is the example vignette for function: ff_ds_az_cts_loop from the MEconTools Package. F(a,z) discrete probability mass function given policy function solution with continuous savings choices.

  • Distribution for Common Choice and States Grid Loop: ff_ds_az_cts_loop

  • Distribution for States Grid + Continuous Exact Savings as Share of Cash-on-Hand Loop: ff_ds_az_cts_loop

  • Distribution for States Grid + Continuous Exact Savings as Share of Cash-on-Hand Vectorized: ff_ds_az_cts_vec

1.1 Test FF_DS_AZ_CTS_LOOP Defaults

Call the function with defaults. By default, shows the asset policy function summary. Model parameters can be changed by the mp_params.

%mp_params
mp_params = containers.Map('KeyType','char', 'ValueType','any');
mp_params('fl_crra') = 1.5;
mp_params('fl_beta') = 0.94;
% call function
ff_ds_az_cts_loop(mp_params);

Elapsed time is 1.912182 seconds.
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_ffcmd ND Array (Matrix etc)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
          i    idx    ndim    numel    rowN    colN     sum      mean      std      coefvari    min     max  
          _    ___    ____    _____    ____    ____    _____    ______    ______    ________    ___    ______

    ap    1     1      2      3000     200      15     42703    14.234    14.307     1.0051      0     51.591

xxx TABLE:ap xxxxxxxxxxxxxxxxxx
              c1        c2        c3        c4        c5        c11        c12       c13       c14       c15  
            ______    ______    ______    ______    ______    _______    _______    ______    ______    ______

    r1           0         0         0         0         0    0.58655    0.89911    1.2884    1.7803    2.3861
    r2           0         0         0         0         0    0.58671    0.89914    1.2885    1.7804    2.3862
    r3           0         0         0         0         0     0.5871    0.89961    1.2888    1.7808    2.3867
    r4           0         0         0         0         0    0.58803    0.90058    1.2898    1.7817    2.3877
    r5           0         0         0         0         0    0.58953    0.90208    1.2914    1.7831    2.3891
    r196    45.655    45.699    45.725    45.798    45.889     47.025     47.404    47.828    48.358    49.028
    r197    46.257    46.303    46.326    46.401    46.492     47.626     48.005    48.432    48.965    49.651
    r198    46.863     46.91    46.931    47.007    47.097     48.232     48.611    49.041     49.59    50.294
    r199    47.472    47.521    47.542    47.617    47.711     48.843     49.222    49.658    50.235     50.94
    r200    48.088    48.134    48.157    48.232    48.326     49.459     49.841    50.311    50.885    51.591

FF_DS_AZ_CTS_LOOP finished. Distribution took = 0.69766
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_ddcmd ND Array (Matrix etc)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
           i    idx    ndim    numel    rowN    colN    sum       mean          std       coefvari       min          max   
           _    ___    ____    _____    ____    ____    ___    __________    _________    ________    __________    ________

    fa     1     1      2       200     200       1      1          0.005    0.0096174     1.9235              0     0.11604
    faz    2     2      2      3000     200      15      1     0.00033333    0.0011636     3.4908              0    0.032295
    fz     3     3      2        15      15       1      1       0.066667     0.076895     1.1534     6.1035e-05     0.20947

xxx TABLE:fa xxxxxxxxxxxxxxxxxx
                c1    
            __________

    r1         0.11604
    r2               0
    r3       0.0004751
    r4      0.00026799
    r5       0.0029727
    r196    3.5618e-14
    r197    2.1735e-14
    r198     1.329e-14
    r199    8.3938e-15
    r200    8.2751e-15

xxx TABLE:faz xxxxxxxxxxxxxxxxxx
                c1            c2            c3            c4            c5           c11           c12           c13           c14           c15    
            __________    __________    __________    __________    __________    __________    __________    __________    __________    __________

    r1      4.1559e-05    0.00053618     0.0031141      0.010616      0.023097    9.8338e-05    8.1894e-06    4.3385e-07    1.3284e-08    1.7934e-10
    r2               0             0             0             0             0             0             0             0             0             0
    r3      2.0452e-10    1.1226e-08    2.5837e-07    3.2065e-06    2.2865e-05    1.2294e-06    1.0693e-07    5.8481e-09    1.8347e-10    2.5249e-12
    r4      8.6656e-10    2.8074e-08     3.684e-07    2.7287e-06    1.4098e-05     6.831e-07    5.9408e-08     3.249e-09    1.0193e-10    1.4026e-12
    r5      9.2776e-08    2.9148e-06     3.479e-05    0.00019689    0.00056423    2.3628e-06    1.9305e-07    1.0072e-08    3.0458e-10    4.0697e-12
    r196    1.6685e-22    7.5909e-21    1.5483e-19    1.8762e-18    1.5117e-17    7.3723e-15    8.1882e-15    6.5347e-15    3.3448e-15    8.2909e-16
    r197    4.6363e-23    2.3916e-21     5.523e-20    7.5562e-19    6.8327e-18    4.5113e-15    5.0046e-15    4.0053e-15    2.0624e-15     5.148e-16
    r198    8.2487e-24    4.9336e-22    1.3328e-20    2.1488e-19    2.2991e-18    2.8157e-15    3.0885e-15    2.4579e-15    1.2688e-15    3.1814e-16
    r199    6.6913e-25    5.3279e-23    1.9003e-21    4.0019e-20    5.5219e-19    1.9017e-15    2.0244e-15    1.5281e-15    7.7436e-16    1.9614e-16
    r200    2.8381e-26     2.725e-24    1.1911e-22    3.1319e-21    5.5136e-20    1.4819e-15    2.2618e-15    2.1457e-15    1.1964e-15    3.1409e-16

xxx TABLE:fz xxxxxxxxxxxxxxxxxx
               c1    
           __________

    r1     6.1035e-05
    r2     0.00085449
    r3      0.0055542
    r4       0.022217
    r5       0.061096
    r11      0.061096
    r12      0.022217
    r13     0.0055542
    r14    0.00085449
    r15    6.1035e-05

xxx tb_outcomes: all stats xxx
    OriginalVariableNames         ap             v             c             y            coh        savefraccoh
    ______________________    __________    ___________    __________    __________    __________    ___________

    {'mean'              }         1.675         5.0913        1.4673         1.467        3.1423       0.37474 
    {'unweighted_sum'    }         42703          26797        7295.8        6979.8         49998        1657.9 
    {'sd'                }        2.0062         1.7215       0.36267       0.51485        2.3189       0.24932 
    {'coefofvar'         }        1.1977        0.33813       0.24717       0.35095       0.73794       0.66532 
    {'gini'              }       0.59404        0.19113       0.13962       0.19161       0.37632       0.39022 
    {'min'               }             0        -1.2641       0.38052       0.38052       0.38052             0 
    {'max'               }        51.591         16.787        5.0209        6.6099         56.61       0.91805 
    {'pYis0'             }       0.11606              0             0             0             0       0.11606 
    {'pYls0'             }             0     0.00066766             0             0             0             0 
    {'pYgr0'             }       0.88394        0.99933             1             1             1       0.88394 
    {'pYisMINY'          }       0.11606     4.1559e-05    4.1559e-05    4.1559e-05    4.1559e-05       0.11606 
    {'pYisMAXY'          }    3.1409e-16     3.1409e-16     5.148e-16    3.1409e-16    3.1409e-16    2.8381e-26 
    {'p0_01'             }             0       -0.34507       0.45473       0.45473       0.45473             0 
    {'p0_1'              }             0        0.52204       0.54342       0.54342       0.54342             0 
    {'p1'                }             0         1.3412        0.6494        0.6494        0.6494             0 
    {'p5'                }             0         2.1813       0.85431       0.77605       0.88697             0 
    {'p10'               }             0         2.8514       0.96477       0.92741         1.002             0 
    {'p20'               }       0.10665         3.5986        1.1516        1.0358        1.3244      0.083657 
    {'p25'               }       0.21483         3.8501        1.2354        1.1105        1.4524       0.14274 
    {'p30'               }       0.32994         4.2218         1.284         1.129        1.6395       0.20194 
    {'p40'               }       0.60561         4.5759        1.3788        1.3244         1.999       0.30454 
    {'p50'               }        0.9866         5.0443        1.4671         1.363        2.4484       0.39896 
    {'p60'               }        1.4331         5.4957        1.5615        1.5828        2.9924       0.48032 
    {'p70'               }        2.0261         5.9595        1.6562        1.6429         3.671         0.556 
    {'p75'               }        2.4055         6.2377        1.7089        1.7094        4.0981       0.59225 
    {'p80'               }        2.8929         6.5441        1.7669        1.9106        4.6329       0.62436 
    {'p90'               }        4.3431         7.3623        1.9254         2.123        6.2699       0.69668 
    {'p95'               }        5.7881         8.0262        2.0625        2.4019        7.7831       0.74075 
    {'p99'               }        8.9453         9.2776        2.3421        2.9539        11.327       0.79763 
    {'p99_9'             }        13.367         10.599        2.6636        3.7357        15.962       0.83767 
    {'p99_99'            }        17.333         11.639        2.9483        4.3328        20.294       0.85903 
    {'fl_cov_ap'         }        4.0248         2.8944       0.61038       0.64355        4.6352       0.41772 
    {'fl_cor_ap'         }             1        0.83807       0.83891       0.62307       0.99637       0.83512 
    {'fl_cov_v'          }        2.8944         2.9636       0.62238       0.79332        3.5168       0.36874 
    {'fl_cor_v'          }       0.83807              1       0.99685       0.89507       0.88097       0.85912 
    {'fl_cov_c'          }       0.61038        0.62238       0.13153       0.16405       0.74192      0.079746 
    {'fl_cor_c'          }       0.83891        0.99685             1       0.87859        0.8822       0.88192 
    {'fl_cov_y'          }       0.64355        0.79332       0.16405       0.26507       0.80761      0.079867 
    {'fl_cor_y'          }       0.62307        0.89507       0.87859             1       0.67647        0.6222 
    {'fl_cov_coh'        }        4.6352         3.5168       0.74192       0.80761        5.3771       0.49746 
    {'fl_cor_coh'        }       0.99637        0.88097        0.8822       0.67647             1       0.86045 
    {'fl_cov_savefraccoh'}       0.41772        0.36874      0.079746      0.079867       0.49746      0.062162 
    {'fl_cor_savefraccoh'}       0.83512        0.85912       0.88192        0.6222       0.86045             1 
    {'fracByP0_01'       }             0    -4.8153e-05    0.00017799    0.00018159    8.3115e-05             0 
    {'fracByP0_1'        }             0     0.00027167     0.0013548     0.0014279    0.00063242             0 
    {'fracByP1'          }             0      0.0032852     0.0063125     0.0069982     0.0029338             0 
    {'fracByP5'          }             0       0.016969      0.025021      0.024262      0.011819             0 
    {'fracByP10'         }             0       0.044207       0.05664      0.064855      0.026579             0 
    {'fracByP20'         }     0.0026834         0.1115       0.13073       0.11733      0.067668     0.0099043 
    {'fracByP25'         }     0.0076113        0.14492       0.17311       0.15549         0.086      0.025483 
    {'fracByP30'         }      0.015302        0.19105       0.21762       0.19333       0.11182      0.048984 
    {'fracByP40'         }      0.043894        0.27218       0.30467       0.27748       0.16912       0.11643 
    {'fracByP50'         }      0.089861        0.36738       0.40369       0.36807       0.23805       0.21205 
    {'fracByP60'         }       0.16112        0.46928       0.50828       0.46652        0.3263       0.32962 
    {'fracByP70'         }       0.26525        0.58046       0.61519       0.57507        0.4298       0.46793 
    {'fracByP75'         }       0.33325        0.64122       0.67431       0.63025       0.49166       0.54754 
    {'fracByP80'         }       0.41265        0.70474       0.73277       0.69273       0.56293       0.62653 
    {'fracByP90'         }       0.62139        0.84051       0.85792       0.82668       0.73375       0.80195 
    {'fracByP95'         }       0.77085        0.91406        0.9245       0.90615       0.84324       0.89716 
    {'fracByP99'         }       0.93558        0.98098       0.98317       0.97729       0.95807       0.97822 
    {'fracByP99_9'       }       0.99103        0.99787       0.99814        0.9972       0.99438       0.99775 
    {'fracByP99_99'      }       0.99886        0.99977       0.99979       0.99969       0.99931       0.99977 

1.2 Test FF_DS_AZ_CTS_LOOP Speed Tests

Call the function with different a and z grid size, print out speed:

mp_support = containers.Map('KeyType','char', 'ValueType','any');
mp_support('bl_timer') = true;
mp_support('ls_ffcmd') = {};
mp_support('ls_ddcmd') = {};
mp_support('ls_ddgrh') = {};
mp_support('bl_show_stats_table') = false;
% A grid 50, shock grid 5:
mp_params = containers.Map('KeyType','char', 'ValueType','any');
mp_params('it_a_n') = 50;
mp_params('it_z_n') = 5;
ff_ds_az_cts_loop(mp_params, mp_support);

Elapsed time is 0.466529 seconds.
FF_DS_AZ_CTS_LOOP finished. Distribution took = 0.065434

% A grid 100, shock grid 7:
mp_params = containers.Map('KeyType','char', 'ValueType','any');
mp_params('it_a_n') = 100;
mp_params('it_z_n') = 7;
ff_ds_az_cts_loop(mp_params, mp_support);

Elapsed time is 0.930211 seconds.
FF_DS_AZ_CTS_LOOP finished. Distribution took = 0.20136

% A grid 200, shock grid 9:
mp_params = containers.Map('KeyType','char', 'ValueType','any');
mp_params('it_a_n') = 200;
mp_params('it_z_n') = 9;
ff_ds_az_cts_loop(mp_params, mp_support);

Elapsed time is 1.614469 seconds.
FF_DS_AZ_CTS_LOOP finished. Distribution took = 0.52925

1.3 Test FF_DS_AZ_CTS_LOOP A grid 100 Shock grid 7

Call the function with different a and z grid size, print out speed:

mp_support = containers.Map('KeyType','char', 'ValueType','any');
mp_support('bl_timer') = true;
mp_support('ls_ffcmd') = {};
mp_support('ls_ddcmd') = {};
mp_support('ls_ddgrh') = {'faz','fa'};
mp_support('bl_show_stats_table') = true;
mp_params = containers.Map('KeyType','char', 'ValueType','any');
mp_params('it_a_n') = 100;
mp_params('it_z_n') = 7;
ff_ds_az_cts_loop(mp_params, mp_support);

Elapsed time is 0.899597 seconds.
FF_DS_AZ_CTS_LOOP finished. Distribution took = 0.25939

xxx tb_outcomes: all stats xxx
    OriginalVariableNames         ap            v             c             y            coh        savefraccoh
    ______________________    __________    __________    __________    __________    __________    ___________

    {'mean'              }        3.2216        6.9329        1.5295        1.5289        4.7511       0.52357 
    {'unweighted_sum'    }         10019        7323.6        1530.6        1473.6         11549        457.17 
    {'sd'                }        3.2562        2.1508       0.34914        0.5307        3.5687       0.25504 
    {'coefofvar'         }        1.0107       0.31024       0.22827       0.34711       0.75113       0.48712 
    {'gini'              }       0.52352       0.17526       0.12797       0.19065        0.3936        0.2723 
    {'min'               }             0        1.7008       0.58543       0.58543       0.58543             0 
    {'max'               }        50.789        19.213          4.21        4.9969        54.997       0.92702 
    {'pYis0'             }      0.062608             0             0             0             0      0.062608 
    {'pYls0'             }             0             0             0             0             0             0 
    {'pYgr0'             }       0.93739             1             1             1             1       0.93739 
    {'pYisMINY'          }      0.062608     0.0049772     0.0049772     0.0049772     0.0049772      0.062608 
    {'pYisMAXY'          }    2.9501e-11    2.9501e-11    3.1223e-11    2.9501e-11    2.9501e-11     1.494e-14 
    {'p0_01'             }             0        1.7008       0.58543       0.58543       0.58543             0 
    {'p0_1'              }             0        1.7008       0.58543       0.58543       0.58543             0 
    {'p1'                }             0        2.9492       0.76855       0.62688       0.76855             0 
    {'p5'                }             0        3.4945       0.97884       0.78105         1.009             0 
    {'p10'               }      0.092835        4.1716        1.0603       0.97609         1.223      0.078835 
    {'p20'               }       0.47609        5.1938        1.2588        1.0456        1.7419       0.27652 
    {'p25'               }        0.7311        5.3812        1.3008         1.094        2.0576       0.35312 
    {'p30'               }       0.97803        5.6276         1.351         1.188        2.3618       0.42581 
    {'p40'               }        1.5512        6.3139        1.4528         1.349        3.0158       0.51932 
    {'p50'               }         2.233        6.8328        1.5245        1.4175        3.7588       0.59714 
    {'p60'               }        3.0801         7.416        1.6192        1.5453        4.6604       0.66085 
    {'p70'               }         4.105        8.0461        1.7025        1.7909        5.7649       0.70987 
    {'p75'               }        4.6992        8.4292        1.7544          1.84        6.4292       0.73355 
    {'p80'               }        5.4329        8.7432        1.8159        1.9097        7.3478       0.75277 
    {'p90'               }        7.7004        9.7559        1.9663        2.3407        9.5263       0.79745 
    {'p95'               }        9.7011        10.662        2.1066        2.5036        11.722       0.82522 
    {'p99'               }        14.279        12.148        2.3613        3.1795        16.608       0.85983 
    {'p99_9'             }        19.899        13.734        2.6792        3.5223        22.615        0.8829 
    {'p99_99'            }        25.265        14.885        2.9563        3.7789        28.175        0.8962 
    {'fl_cov_ap'         }        10.603        6.2617        1.0053        1.0453        11.608       0.65544 
    {'fl_cor_ap'         }             1       0.89408        0.8843       0.60489       0.99896       0.78925 
    {'fl_cov_v'          }        6.2617         4.626       0.74802       0.96794        7.0097       0.47179 
    {'fl_cor_v'          }       0.89408             1       0.99613         0.848       0.91325       0.86007 
    {'fl_cov_c'          }        1.0053       0.74802        0.1219       0.15425        1.1272      0.078595 
    {'fl_cor_c'          }        0.8843       0.99613             1       0.83252        0.9047       0.88265 
    {'fl_cov_y'          }        1.0453       0.96794       0.15425       0.28164        1.1995      0.078136 
    {'fl_cor_y'          }       0.60489         0.848       0.83252             1       0.63337       0.57729 
    {'fl_cov_coh'        }        11.608        7.0097        1.1272        1.1995        12.735       0.73404 
    {'fl_cor_coh'        }       0.99896       0.91325        0.9047       0.63337             1        0.8065 
    {'fl_cov_savefraccoh'}       0.65544       0.47179      0.078595      0.078136       0.73404      0.065046 
    {'fl_cor_savefraccoh'}       0.78925       0.86007       0.88265       0.57729        0.8065             1 
    {'fracByP0_01'       }             0      0.001221     0.0019051     0.0019058    0.00061329             0 
    {'fracByP0_1'        }             0      0.001221     0.0019051     0.0019058    0.00061329             0 
    {'fracByP1'          }             0      0.011511      0.013437     0.0039104     0.0042425             0 
    {'fracByP5'          }             0      0.021279      0.026546      0.024488      0.012268             0 
    {'fracByP10'         }     0.0006892       0.05109      0.059758      0.051739      0.020676     0.0036864 
    {'fracByP20'         }     0.0099846       0.12278        0.1366       0.12131      0.052438      0.038521 
    {'fracByP25'         }      0.019425       0.15429       0.17945       0.15485      0.072434      0.070039 
    {'fracByP30'         }      0.032212       0.19399       0.22206       0.19029      0.094665       0.10974 
    {'fracByP40'         }        0.0737       0.28144       0.31482       0.27941       0.15063       0.20042 
    {'fracByP50'         }        0.1321        0.3768       0.41124       0.37234       0.22365       0.30981 
    {'fracByP60'         }       0.21336       0.48025       0.51513        0.4642       0.31463       0.42631 
    {'fracByP70'         }        0.3254       0.59015       0.62157       0.57794       0.42288       0.55601 
    {'fracByP75'         }       0.39769       0.65462       0.67967        0.6363       0.48537       0.62983 
    {'fracByP80'         }       0.47503       0.71232       0.73844       0.70062       0.56134       0.69967 
    {'fracByP90'         }       0.67403       0.84445       0.86104       0.82867       0.73331       0.84375 
    {'fracByP95'         }       0.80886       0.92029       0.92647       0.90776       0.84668       0.92112 
    {'fracByP99'         }       0.95057       0.98162       0.98401       0.97831       0.96163       0.98352 
    {'fracByP99_9'       }       0.99336       0.99797       0.99826       0.99778       0.99494       0.99833 
    {'fracByP99_99'      }       0.99924       0.99979       0.99981       0.99977        0.9994       0.99984 

1.4 Test FF_DS_AZ_CTS_LOOP A grid 300 Shock grid 25

mp_support = containers.Map('KeyType','char', 'ValueType','any');
mp_support('bl_timer') = true;
mp_support('ls_ffcmd') = {};
mp_support('ls_ddcmd') = {};
mp_support('ls_ddgrh') = {'faz','fa'};
mp_support('bl_show_stats_table') = true;
mp_params = containers.Map('KeyType','char', 'ValueType','any');
mp_params('it_a_n') = 300;
mp_params('it_z_n') = 25;
ff_ds_az_cts_loop(mp_params, mp_support);

Elapsed time is 7.769713 seconds.
FF_DS_AZ_CTS_LOOP finished. Distribution took = 2.2408

xxx tb_outcomes: all stats xxx
    OriginalVariableNames         ap            v             c             y            coh        savefraccoh
    ______________________    __________    __________    __________    __________    __________    ___________

    {'mean'              }        3.2612        6.9497        1.5318        1.5305         4.793       0.52715 
    {'unweighted_sum'    }    1.1043e+05         79555         16733         19751    1.2716e+05        3442.8 
    {'sd'                }        3.3352        2.1663       0.35078        0.5359        3.6495       0.25199 
    {'coefofvar'         }        1.0227       0.31171         0.229       0.35014       0.76143       0.47803 
    {'gini'              }       0.52534       0.17597       0.12824       0.19145       0.39608       0.26748 
    {'min'               }             0       -2.7616       0.25871       0.25871       0.25871             0 
    {'max'               }        54.451        20.418        4.3301        8.7798         58.78       0.92837 
    {'pYis0'             }       0.04941             0             0             0             0       0.04941 
    {'pYls0'             }             0    7.3281e-05             0             0             0             0 
    {'pYgr0'             }       0.95059       0.99993             1             1             1       0.95059 
    {'pYisMINY'          }       0.04941    3.1163e-08    3.1163e-08    3.1163e-08    3.1163e-08       0.04941 
    {'pYisMAXY'          }    2.8477e-13    2.8477e-13     1.121e-13    2.8477e-13    2.8477e-13    3.6157e-25 
    {'p0_01'             }             0       0.33584       0.44588       0.42374       0.44588             0 
    {'p0_1'              }             0        1.0287       0.51088       0.51088       0.51088             0 
    {'p1'                }             0          2.33       0.67226       0.67069       0.67505             0 
    {'p5'                }     0.0027154        3.5353       0.94151        0.8016        1.0088      0.002787 
    {'p10'               }       0.11496        4.1978        1.0921        0.9095        1.2356      0.093483 
    {'p20'               }       0.51133         5.096        1.2504        1.0657         1.779       0.28788 
    {'p25'               }       0.75298        5.4004        1.3077        1.1577        2.0685       0.36173 
    {'p30'               }         1.004        5.7312        1.3565        1.1951        2.3792       0.42532 
    {'p40'               }        1.5834         6.298        1.4458        1.3352        3.0372       0.52408 
    {'p50'               }        2.2686        6.8433        1.5287         1.441        3.7996       0.59884 
    {'p60'               }        3.0898        7.4098        1.6132        1.5764        4.6904       0.65811 
    {'p70'               }        4.0971        8.0297        1.7037        1.7526        5.7899       0.70877 
    {'p75'               }        4.7228        8.3787        1.7552        1.8223         6.462       0.73135 
    {'p80'               }        5.4827        8.7742        1.8144        1.9267        7.2769       0.75357 
    {'p90'               }        7.7718        9.8224        1.9746        2.2406        9.6945       0.79922 
    {'p95'               }        9.9683        10.704        2.1148        2.5163        12.048       0.82675 
    {'p99'               }        14.759        12.325        2.3956         3.157        17.176       0.86245 
    {'p99_9'             }        21.215        14.066        2.7525        3.9803        23.946       0.88686 
    {'p99_99'            }        27.205        15.415        3.0759        4.7968        30.277       0.90047 
    {'fl_cov_ap'         }        11.123        6.4528        1.0361        1.0808         12.16       0.65691 
    {'fl_cor_ap'         }             1       0.89313       0.88563       0.60472         0.999       0.78162 
    {'fl_cov_v'          }        6.4528        4.6928       0.75717       0.98035          7.21       0.46786 
    {'fl_cor_v'          }       0.89313             1       0.99643       0.84447       0.91198       0.85705 
    {'fl_cov_c'          }        1.0361       0.75717       0.12304       0.15594        1.1592       0.07767 
    {'fl_cor_c'          }       0.88563       0.99643             1       0.82954       0.90548       0.87868 
    {'fl_cov_y'          }        1.0808       0.98035       0.15594       0.28718        1.2368      0.077234 
    {'fl_cor_y'          }       0.60472       0.84447       0.82954             1       0.63237       0.57192 
    {'fl_cov_coh'        }         12.16          7.21        1.1592        1.2368        13.319       0.73458 
    {'fl_cor_coh'        }         0.999       0.91198       0.90548       0.63237             1       0.79876 
    {'fl_cov_savefraccoh'}       0.65691       0.46786       0.07767      0.077234       0.73458      0.063501 
    {'fl_cor_savefraccoh'}       0.78162       0.85705       0.87868       0.57192       0.79876             1 
    {'fracByP0_01'       }             0    7.2341e-06    8.9677e-05    2.5415e-05    2.8657e-05             0 
    {'fracByP0_1'        }             0    0.00014925    0.00040034    0.00047536    0.00012777             0 
    {'fracByP1'          }             0     0.0031002      0.004056     0.0057421     0.0012982             0 
    {'fracByP5'          }    4.4271e-07      0.020663      0.026101      0.023318      0.010275    3.7554e-06 
    {'fracByP10'         }    0.00081444      0.049128      0.059669      0.051817      0.020124     0.0043579 
    {'fracByP20'         }      0.010142       0.11647       0.13733        0.1174      0.051401      0.041452 
    {'fracByP25'         }        0.0197       0.15487       0.17845       0.15395       0.07176       0.07241 
    {'fracByP30'         }      0.033115       0.19474       0.22243       0.19298      0.095014       0.11033 
    {'fracByP40'         }       0.07268       0.28138       0.31442       0.27544       0.15079       0.20152 
    {'fracByP50'         }       0.13241        0.3756       0.41097       0.36527       0.22198       0.30736 
    {'fracByP60'         }       0.21444       0.47892       0.51282       0.46572       0.31091       0.42746 
    {'fracByP70'         }         0.323       0.58868       0.62139       0.57261       0.41949       0.55675 
    {'fracByP75'         }       0.39061        0.6478       0.67743       0.63129       0.48319       0.62572 
    {'fracByP80'         }       0.46952       0.70943       0.73587        0.6919       0.55532       0.69697 
    {'fracByP90'         }       0.66831       0.84297       0.85906       0.82754       0.72955       0.84259 
    {'fracByP95'         }       0.80219       0.91616       0.92541       0.90507       0.84194       0.91979 
    {'fracByP99'         }       0.94613       0.98125       0.98339       0.97711       0.95822       0.98365 
    {'fracByP99_9'       }        0.9927        0.9979       0.99812       0.99719       0.99443       0.99831 
    {'fracByP99_99'      }       0.99909       0.99977       0.99979       0.99967       0.99932       0.99983 

1.5 Test FF_DS_AZ_CTS_LOOP A grid 300 Shock grid 50

mp_support = containers.Map('KeyType','char', 'ValueType','any');
mp_support('bl_timer') = true;
mp_support('ls_ffcmd') = {};
mp_support('ls_ddcmd') = {};
mp_support('ls_ddgrh') = {'faz','fa'};
mp_support('bl_show_stats_table') = true;
mp_params = containers.Map('KeyType','char', 'ValueType','any');
mp_params('it_a_n') = 300;
mp_params('it_z_n') = 50;
ff_ds_az_cts_loop(mp_params, mp_support);

Elapsed time is 13.966894 seconds.
FF_DS_AZ_CTS_LOOP finished. Distribution took = 5.0619

xxx tb_outcomes: all stats xxx
    OriginalVariableNames         ap             v             c             y            coh        savefraccoh
    ______________________    __________    ___________    __________    __________    __________    ___________

    {'mean'              }        3.2794          6.957        1.5328        1.5312        4.8122       0.52801 
    {'unweighted_sum'    }    2.3346e+05     1.6237e+05         34668         53309    2.6813e+05        5324.8 
    {'sd'                }        3.3623         2.1722       0.35142       0.53693        3.6772       0.25195 
    {'coefofvar'         }        1.0253        0.31224       0.22927       0.35065       0.76415       0.47717 
    {'gini'              }       0.52595        0.17618       0.12829       0.19144        0.3969       0.26705 
    {'min'               }             0        -7.6866       0.12843       0.12843       0.12843             0 
    {'max'               }        61.275         22.164        4.3849        15.657        65.657       0.93325 
    {'pYis0'             }      0.049376              0             0             0             0      0.049376 
    {'pYls0'             }             0     0.00011917             0             0             0             0 
    {'pYgr0'             }       0.95062        0.99988             1             1             1       0.95062 
    {'pYisMINY'          }      0.049376     1.1048e-15    1.1048e-15    1.1048e-15    1.1048e-15      0.049376 
    {'pYisMAXY'          }     1.584e-18      1.584e-18    5.0847e-19     1.584e-18     1.584e-18     1.584e-18 
    {'p0_01'             }             0       -0.20427       0.40271       0.40271       0.40271             0 
    {'p0_1'              }             0         1.2141       0.53589       0.48816       0.53589             0 
    {'p1'                }             0         2.3693       0.71312       0.64833       0.71312             0 
    {'p5'                }      0.001023         3.5435       0.94895       0.80724       0.96945     0.0010781 
    {'p10'               }       0.11645         4.2417        1.0917       0.93681        1.2501      0.095192 
    {'p20'               }       0.50875           5.08        1.2515         1.072        1.7735        0.2902 
    {'p25'               }       0.75899         5.4247        1.3061        1.1504        2.0649       0.36356 
    {'p30'               }        1.0156         5.7325        1.3564        1.2011        2.3741       0.42667 
    {'p40'               }        1.6036         6.2932        1.4459        1.3198        3.0387       0.52518 
    {'p50'               }        2.2768         6.8406        1.5297        1.4423        3.8053       0.59933 
    {'p60'               }        3.0945         7.4051        1.6122        1.5771        4.7002        0.6586 
    {'p70'               }         4.113         8.0338        1.7042        1.7334        5.8225       0.70999 
    {'p75'               }        4.7604         8.3794        1.7554        1.8278        6.4985       0.73226 
    {'p80'               }        5.5142         8.7771        1.8143        1.9295        7.3239       0.75424 
    {'p90'               }        7.8048         9.8378        1.9756        2.2476        9.7629       0.80013 
    {'p95'               }        10.007         10.714        2.1161        2.5336        12.107       0.82766 
    {'p99'               }          14.9         12.348         2.407        3.1578        17.285       0.86312 
    {'p99_9'             }        21.501          14.13        2.7694        4.0322        24.216       0.88766 
    {'p99_99'            }        27.735         15.514        3.1037        4.8946        30.851       0.90127 
    {'fl_cov_ap'         }        11.305         6.5234        1.0466        1.0907        12.352       0.66084 
    {'fl_cor_ap'         }             1        0.89316       0.88579       0.60415       0.99902       0.78009 
    {'fl_cov_v'          }        6.5234         4.7186       0.76066       0.98362        7.2841       0.46879 
    {'fl_cor_v'          }       0.89316              1       0.99645       0.84334        0.9119       0.85658 
    {'fl_cov_c'          }        1.0466        0.76066        0.1235       0.15645        1.1701      0.077707 
    {'fl_cor_c'          }       0.88579        0.99645             1       0.82914        0.9055       0.87766 
    {'fl_cov_y'          }        1.0907        0.98362       0.15645        0.2883        1.2471        0.0772 
    {'fl_cor_y'          }       0.60415        0.84334       0.82914             1       0.63165       0.57067 
    {'fl_cov_coh'        }        12.352         7.2841        1.1701        1.2471        13.522       0.73855 
    {'fl_cor_coh'        }       0.99902         0.9119        0.9055       0.63165             1       0.79716 
    {'fl_cov_savefraccoh'}       0.66084        0.46879      0.077707        0.0772       0.73855      0.063478 
    {'fl_cor_savefraccoh'}       0.78009        0.85658       0.87766       0.57067       0.79716             1 
    {'fracByP0_01'       }             0    -7.0657e-06    2.6272e-05    3.0716e-05    8.3673e-06             0 
    {'fracByP0_1'        }             0     8.1733e-05    0.00058172        0.0003    0.00018482             0 
    {'fracByP1'          }             0      0.0025825     0.0055755     0.0043105     0.0017358             0 
    {'fracByP5'          }    1.3446e-07       0.020553      0.028388      0.023343     0.0084443     1.165e-06 
    {'fracByP10'         }    0.00082822       0.048923      0.059616      0.051792      0.020041     0.0045383 
    {'fracByP20'         }      0.010119        0.11678        0.1368        0.1176      0.051426      0.041679 
    {'fracByP25'         }      0.019764        0.15445       0.17846       0.15402      0.071298       0.07291 
    {'fracByP30'         }      0.033198        0.19437       0.22195       0.19279      0.094487       0.11072 
    {'fracByP40'         }      0.072799        0.28088       0.31405       0.27516       0.15079       0.20093 
    {'fracByP50'         }       0.13186        0.37535       0.41129       0.36559       0.22202       0.30846 
    {'fracByP60'         }       0.21318        0.47748       0.51316       0.46495       0.30966       0.42828 
    {'fracByP70'         }       0.32222        0.58845       0.62103       0.57307       0.41837       0.55682 
    {'fracByP75'         }       0.39045        0.64744       0.67785       0.63075       0.48233       0.62537 
    {'fracByP80'         }       0.46786         0.7092       0.73555       0.69205       0.55399       0.69588 
    {'fracByP90'         }       0.66756        0.84275        0.8587       0.82726       0.72947       0.84385 
    {'fracByP95'         }       0.80166        0.91607       0.92521       0.90478       0.84112       0.91991 
    {'fracByP99'         }       0.94602        0.98111       0.98335       0.97699       0.95791       0.98349 
    {'fracByP99_9'       }       0.99264        0.99789        0.9981       0.99714       0.99438       0.99831 
    {'fracByP99_99'      }       0.99908        0.99977       0.99979       0.99966        0.9993       0.99983