1 Distribution Exact Savings Choices Vectorized

This is the example vignette for function: snw_ds_main_vec from the PrjOptiSNW Package. This function solves for vfi and gets distribution induced by policy functions and exogenous distributions. Vectorized vfi and distribution methods.

1.1 Test SNW_DS_MAIN_VEC

Call the function with testing defaults.

% mp_params = snw_mp_param('default_dense');
mp_params = snw_mp_param('default_docdense');
mp_controls = snw_mp_control('default_test');
mp_controls('bl_print_vfi') = false;
mp_controls('bl_print_ds') = true;
mp_controls('bl_print_ds_verbose') = false;
[Phi_true,Phi_adj,A_agg,Y_inc_agg,it,mp_dsvfi_results] = snw_ds_main_vec(mp_params, mp_controls);

Completed SNW_VFI_MAIN_BISEC_VEC;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;time=543.5601
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_outcomes ND Array (Matrix etc)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                i    idx    ndim     numel      rowN      colN           sum         mean       std      coefvari      min          max    
                _    ___    ____    ________    ____    _________    ___________    _______    ______    ________    ________    __________

    V_VFI       1     1      6      4.37e+07     83     5.265e+05    -8.6673e+08    -19.834    28.177    -1.4206      -615.77    -0.0071775
    ap_VFI      2     2      6      4.37e+07     83     5.265e+05     1.4164e+09     32.412      36.8     1.1354            0        163.73
    cons_VFI    3     3      6      4.37e+07     83     5.265e+05      2.131e+08     4.8764    8.3268     1.7076     0.036717        141.61

xxx TABLE:V_VFI xxxxxxxxxxxxxxxxxx
             c1         c2         c3         c4         c5        c526496      c526497      c526498      c526499      c526500 
           _______    _______    _______    _______    _______    _________    _________    _________    _________    _________

    r1     -376.05    -375.66    -373.17     -367.4    -358.05        -6.68      -6.5297      -6.3792      -6.2274      -6.0722
    r2      -363.8    -363.41    -360.93    -355.25    -346.25      -6.4892      -6.3437      -6.1974      -6.0495      -5.8977
    r3     -351.75    -351.36     -348.9    -343.44     -334.9      -6.2948      -6.1538      -6.0116      -5.8671      -5.7186
    r4     -339.81    -339.45    -337.16    -332.06    -324.04       -6.095      -5.9584        -5.82      -5.6786       -5.533
    r5     -328.99    -328.65    -326.51    -321.72    -314.17      -5.9054      -5.7725      -5.6372      -5.4986      -5.3556
    r79    -14.033     -14.02    -13.926    -13.689    -13.287     -0.22848     -0.21775     -0.20768     -0.19824     -0.18938
    r80    -12.564     -12.55    -12.457     -12.22    -11.818     -0.17427     -0.16611     -0.15842     -0.15117     -0.14434
    r81    -10.778    -10.764    -10.671    -10.434    -10.032     -0.11927     -0.11368     -0.10843     -0.10346    -0.098767
    r82    -8.4226    -8.4089    -8.3155    -8.0786    -7.6766     -0.06597     -0.06284    -0.059924    -0.057184    -0.054584
    r83    -5.0665    -5.0529    -4.9595    -4.7226    -4.3206    -0.020968    -0.019972    -0.019038    -0.018161    -0.017336

xxx TABLE:ap_VFI xxxxxxxxxxxxxxxxxx
           c1    c2        c3           c4            c5        c526496    c526497    c526498    c526499    c526500
           __    __    __________    _________    __________    _______    _______    _______    _______    _______

    r1     0     0      0.0005656    0.0075134      0.022901    114.76     120.42     126.29     132.39     138.81 
    r2     0     0     0.00051498    0.0065334      0.021549    114.87     120.54     126.42     132.55     138.97 
    r3     0     0     0.00051498    0.0049294      0.019875    114.98     120.67     126.57     132.72     139.13 
    r4     0     0     0.00051498    0.0047937      0.019672    115.74     121.44     127.36     133.52     139.94 
    r5     0     0     0.00048517    0.0046683      0.019484    116.51     122.22     128.16     134.34     140.76 
    r79    0     0              0            0    0.00051498    81.091      85.68     90.325     94.371      98.41 
    r80    0     0              0            0             0    76.669      80.55     84.292     88.029     91.682 
    r81    0     0              0            0             0    68.313      71.52     74.459     77.816     81.096 
    r82    0     0              0            0             0    50.126     53.467     56.953     58.728     60.587 
    r83    0     0              0            0             0         0          0          0          0          0 

xxx TABLE:cons_VFI xxxxxxxxxxxxxxxxxx
              c1          c2          c3          c4          c5       c526496    c526497    c526498    c526499    c526500
           ________    ________    ________    ________    ________    _______    _______    _______    _______    _______

    r1     0.036717    0.037251    0.040426     0.04363    0.048012    9.6396     9.8066     9.9533      10.06      10.06 
    r2     0.036717    0.037251    0.040477     0.04461    0.049364    9.8014     9.9571     10.088     10.177     10.177 
    r3     0.036717    0.037251    0.040477    0.046214    0.051039    9.9664     10.108      10.22     10.287     10.287 
    r4     0.038144    0.038678    0.041903    0.047776    0.052666    10.118     10.244     10.339     10.388     10.388 
    r5     0.039534    0.040068    0.043323     0.04929    0.054241    10.258     10.369     10.446     10.483     10.483 
    r79     0.19737     0.19791     0.20163     0.21175     0.23093    35.811     37.046     38.418     40.587     42.963 
    r80     0.19737     0.19791     0.20163     0.21175     0.23145    40.207      42.15     44.426     46.904     49.665 
    r81     0.19737     0.19791     0.20163     0.21175     0.23145    48.541     51.158     54.236     57.094     60.229 
    r82     0.19737     0.19791     0.20163     0.21175     0.23145     66.71     69.193     71.724     76.164      80.72 
    r83     0.19737     0.19791     0.20163     0.21175     0.23145    116.82     122.65     128.66     134.88     141.29 

SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:1 of 82, time-this-age:0.3786
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:2 of 82, time-this-age:4.8096
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:3 of 82, time-this-age:5.9174
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:4 of 82, time-this-age:6.508
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:5 of 82, time-this-age:6.8927
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:6 of 82, time-this-age:7.5887
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:7 of 82, time-this-age:8.1099
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:8 of 82, time-this-age:9.0281
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:9 of 82, time-this-age:9.1355
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:10 of 82, time-this-age:11.9284
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:11 of 82, time-this-age:11.8537
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:12 of 82, time-this-age:14.3041
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:13 of 82, time-this-age:14.4545
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:14 of 82, time-this-age:14.7013
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:15 of 82, time-this-age:14.7272
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:16 of 82, time-this-age:14.7332
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:17 of 82, time-this-age:15.1111
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:18 of 82, time-this-age:14.5327
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:19 of 82, time-this-age:15.2564
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:20 of 82, time-this-age:15.4999
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:21 of 82, time-this-age:15.5015
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:22 of 82, time-this-age:16.8247
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:23 of 82, time-this-age:17.1551
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:24 of 82, time-this-age:16.2079
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:25 of 82, time-this-age:16.4377
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:26 of 82, time-this-age:16.5744
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:27 of 82, time-this-age:17.8337
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:28 of 82, time-this-age:17.647
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:29 of 82, time-this-age:17.601
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:30 of 82, time-this-age:17.5908
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:31 of 82, time-this-age:17.2374
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:32 of 82, time-this-age:17.3831
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:33 of 82, time-this-age:17.7541
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:34 of 82, time-this-age:17.2324
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:35 of 82, time-this-age:17.6096
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:36 of 82, time-this-age:17.8942
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:37 of 82, time-this-age:17.3612
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:38 of 82, time-this-age:16.873
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:39 of 82, time-this-age:16.9254
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:40 of 82, time-this-age:16.8782
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:41 of 82, time-this-age:16.5205
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:42 of 82, time-this-age:16.8312
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:43 of 82, time-this-age:16.23
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:44 of 82, time-this-age:16.1342
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:45 of 82, time-this-age:16.4806
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:46 of 82, time-this-age:15.8565
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:47 of 82, time-this-age:15.4775
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:48 of 82, time-this-age:15.4721
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:49 of 82, time-this-age:19.033
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:50 of 82, time-this-age:20.2225
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:51 of 82, time-this-age:20.5336
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:52 of 82, time-this-age:19.8387
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:53 of 82, time-this-age:20.2331
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:54 of 82, time-this-age:20.6319
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:55 of 82, time-this-age:20.6243
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:56 of 82, time-this-age:14.9386
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:57 of 82, time-this-age:14.0026
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:58 of 82, time-this-age:14.161
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:59 of 82, time-this-age:14.8816
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:60 of 82, time-this-age:10.6737
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:61 of 82, time-this-age:16.4232
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:62 of 82, time-this-age:10.5139
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:63 of 82, time-this-age:12.1908
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:64 of 82, time-this-age:11.9561
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:65 of 82, time-this-age:12.7329
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:66 of 82, time-this-age:13.7721
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:67 of 82, time-this-age:12.0024
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:68 of 82, time-this-age:11.9243
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:69 of 82, time-this-age:12.7582
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:70 of 82, time-this-age:12.1532
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:71 of 82, time-this-age:9.4885
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:72 of 82, time-this-age:10.7963
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:73 of 82, time-this-age:11.1703
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:74 of 82, time-this-age:10.3998
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:75 of 82, time-this-age:9.1922
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:76 of 82, time-this-age:11.3241
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:77 of 82, time-this-age:10.0886
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:78 of 82, time-this-age:9.2365
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:79 of 82, time-this-age:7.7439
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:80 of 82, time-this-age:7.7752
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:81 of 82, time-this-age:7.2503
SNW_DS_MAIN_VEC ACUMU MASS: Finished Age Group:82 of 82, time-this-age:6.2078
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:1 of 82, time-this-age:0.4434
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:2 of 82, time-this-age:0.057613
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:3 of 82, time-this-age:0.063844
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:4 of 82, time-this-age:0.050822
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:5 of 82, time-this-age:0.070678
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:6 of 82, time-this-age:0.060849
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:7 of 82, time-this-age:0.065418
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:8 of 82, time-this-age:0.061329
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:9 of 82, time-this-age:0.056986
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:10 of 82, time-this-age:0.063646
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:11 of 82, time-this-age:0.05255
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:12 of 82, time-this-age:0.057059
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:13 of 82, time-this-age:0.048215
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:14 of 82, time-this-age:0.063939
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:15 of 82, time-this-age:0.052633
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:16 of 82, time-this-age:0.056284
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:17 of 82, time-this-age:0.059784
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:18 of 82, time-this-age:0.053468
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:19 of 82, time-this-age:0.064496
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:20 of 82, time-this-age:0.067389
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:21 of 82, time-this-age:0.069029
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:22 of 82, time-this-age:0.051852
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:23 of 82, time-this-age:0.071656
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:24 of 82, time-this-age:0.055803
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:25 of 82, time-this-age:0.050012
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:26 of 82, time-this-age:0.056304
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:27 of 82, time-this-age:0.048197
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:28 of 82, time-this-age:0.048567
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:29 of 82, time-this-age:0.047927
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:30 of 82, time-this-age:0.055782
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:31 of 82, time-this-age:0.065655
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:32 of 82, time-this-age:0.056483
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:33 of 82, time-this-age:0.054022
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:34 of 82, time-this-age:0.048944
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:35 of 82, time-this-age:0.049292
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:36 of 82, time-this-age:0.057768
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:37 of 82, time-this-age:0.05061
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:38 of 82, time-this-age:0.054212
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:39 of 82, time-this-age:0.058645
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:40 of 82, time-this-age:0.04779
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:41 of 82, time-this-age:0.050251
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:42 of 82, time-this-age:0.053709
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:43 of 82, time-this-age:0.059374
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:44 of 82, time-this-age:0.049218
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:45 of 82, time-this-age:0.051461
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:46 of 82, time-this-age:0.046182
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:47 of 82, time-this-age:0.052269
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:48 of 82, time-this-age:0.046998
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:49 of 82, time-this-age:0.067955
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:50 of 82, time-this-age:0.063089
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:51 of 82, time-this-age:0.051776
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:52 of 82, time-this-age:0.049762
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:53 of 82, time-this-age:0.068838
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:54 of 82, time-this-age:0.056374
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:55 of 82, time-this-age:0.079779
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:56 of 82, time-this-age:0.07178
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:57 of 82, time-this-age:0.049449
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:58 of 82, time-this-age:0.062064
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:59 of 82, time-this-age:0.054074
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:60 of 82, time-this-age:0.066304
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:61 of 82, time-this-age:0.056874
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:62 of 82, time-this-age:0.057744
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:63 of 82, time-this-age:0.074837
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:64 of 82, time-this-age:0.054466
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:65 of 82, time-this-age:0.063535
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:66 of 82, time-this-age:0.057064
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:67 of 82, time-this-age:0.058795
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:68 of 82, time-this-age:0.052117
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:69 of 82, time-this-age:0.053227
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:70 of 82, time-this-age:0.065072
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:71 of 82, time-this-age:0.053119
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:72 of 82, time-this-age:0.062005
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:73 of 82, time-this-age:0.05542
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:74 of 82, time-this-age:0.060745
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:75 of 82, time-this-age:0.05168
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:76 of 82, time-this-age:0.051709
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:77 of 82, time-this-age:0.058973
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:78 of 82, time-this-age:0.059053
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:79 of 82, time-this-age:0.069633
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:80 of 82, time-this-age:0.046625
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:81 of 82, time-this-age:0.069697
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:82 of 82, time-this-age:0.049734
SNW_DS_MAIN NORMALIZE MASS: Finished Age Group:83 of 82, time-this-age:0.046755
SNW_DS_MAIN: Share of population with assets equal to upper bound on asset grid:6.8049e-06
SNW_DS_MAIN: Accidental bequests are thrown in the ocean
SNW_DS_MAIN_VEC tax and spend;it=1;err=0.014163
SNW_DS_MAIN_VEC tax and spend;it=2;err=0.011847
SNW_DS_MAIN_VEC tax and spend;it=3;err=0.0098976
SNW_DS_MAIN_VEC tax and spend;it=4;err=0.0082601
SNW_DS_MAIN_VEC tax and spend;it=5;err=0.0068875
SNW_DS_MAIN_VEC tax and spend;it=6;err=0.0057387
SNW_DS_MAIN_VEC tax and spend;it=7;err=0.0047786
SNW_DS_MAIN_VEC tax and spend;it=8;err=0.0039772
SNW_DS_MAIN_VEC tax and spend;it=9;err=0.0033087
SNW_DS_MAIN_VEC tax and spend;it=10;err=0.0027516
SNW_DS_MAIN_VEC tax and spend;it=11;err=0.0022876
SNW_DS_MAIN_VEC tax and spend;it=12;err=0.0019014
SNW_DS_MAIN_VEC tax and spend;it=13;err=0.0015801
SNW_DS_MAIN_VEC tax and spend;it=14;err=0.0013128
SNW_DS_MAIN_VEC tax and spend;it=15;err=0.0010906
SNW_DS_MAIN_VEC tax and spend;it=16;err=0.00090591
SNW_DS_MAIN_VEC tax and spend;it=17;err=0.00075241
SNW_DS_MAIN_VEC tax and spend;it=18;err=0.00062488
SNW_DS_MAIN_VEC tax and spend;it=19;err=0.00051892
SNW_DS_MAIN_VEC tax and spend;it=20;err=0.00043091
SNW_DS_MAIN_VEC tax and spend;it=21;err=0.00035781
SNW_DS_MAIN_VEC tax and spend;it=22;err=0.0002971
SNW_DS_MAIN_VEC tax and spend;it=23;err=0.00024668
SNW_DS_MAIN_VEC tax and spend;it=24;err=0.00020481
SNW_DS_MAIN_VEC tax and spend;it=25;err=0.00017004
SNW_DS_MAIN_VEC tax and spend;it=26;err=0.00014118
SNW_DS_MAIN_VEC tax and spend;it=27;err=0.00011721
SNW_DS_MAIN_VEC tax and spend;it=28;err=9.7309e-05
SNW_DS_MAIN_VEC: Number of a2-adjustments (for taxation) used to balance the government budget= 28
SNW_DS_MAIN_VEC: Old and updated value of a2=1.5286      1.4349
SNW_DS_MAIN_VEC: Aggregates: Cons., Gov. cons., Save, Assets, Income, Bequests 48.70063      11.42006      199.6692       204.333      64.97689      2.666151
SNW_DS_MAIN_VEC: Resource constraint: C_t+A_{t+1}+G_t=A_t+Y_t 264.4537      264.6461
Completed SNW_DS_MAIN_VEC;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;time=1820.5957
xxx tb_outcomes: all stats xxx
     OriginalVariableNames         a_ss         ap_ss        cons_ss        n_ss         y_all       y_head_inc    y_head_earn    y_spouse_inc    yshr_interest    yshr_wage      yshr_SS       yshr_tax      yshr_nttxss
    ________________________    __________    __________    __________    _________    __________    __________    ___________    ____________    _____________    __________    __________    ___________    ___________

    {'mean'                }        4.3602        4.4621        1.0635       2.3554        1.4661        1.1081       0.88655         0.35797          0.12865        0.77402      0.097329        0.17833      0.080996 
    {'unweighted_sum'      }          2228    5.3216e+08    5.0787e+07           21    8.3558e+07    1.9253e+06         19732       4.827e+05       3.8438e+06     8.8881e+06         29012     2.8338e+06    2.8048e+06 
    {'sd'                  }        6.8796        6.9169        0.6938       1.4375        1.4665         1.013       0.92804         0.95437          0.17577        0.33679        0.2266       0.035661       0.24691 
    {'coefofvar'           }        1.5778        1.5501       0.65237      0.61029        1.0003       0.91419        1.0468          2.6661           1.3663        0.43512        2.3282        0.19998        3.0485 
    {'gini'                }        0.6755       0.67638       0.33936       0.3128       0.44546       0.42164       0.53121         0.85269          0.65781         0.2062       0.91382        0.11386        1.2592 
    {'min'                 }             0             0      0.036717            1      0.038108      0.038108             0               0                0              0             0       0.036506      -0.89715 
    {'max'                 }           135        163.73        141.61            6        50.873        24.357        18.957          26.627          0.99299              1             1         0.2552        0.2552 
    {'pYis0'               }       0.11808      0.097968             0            0             0             0        0.2016         0.52499          0.11808        0.10584        0.7984              0             0 
    {'pYls0'               }             0             0             0            0             0             0             0               0                0              0             0              0       0.17487 
    {'pYgr0'               }       0.88192       0.90203             1            1             1             1        0.7984         0.47501          0.88192        0.89416        0.2016              1       0.82513 
    {'pYisMINY'            }       0.11808      0.097968    8.6094e-07      0.36005    8.6094e-07    1.2258e-06        0.2016         0.52499          0.11808        0.10584        0.7984     8.6094e-07     0.0046688 
    {'pYisMAXY'            }    6.8049e-06    2.2836e-12             0     0.041101    2.2836e-12     1.694e-09    1.2258e-07      1.9415e-10                0         0.1117      0.005851     2.2836e-12    2.2836e-12 
    {'p0_01'               }             0             0      0.066342            1      0.069931      0.065666             0               0                0              0             0       0.054112      -0.89715 
    {'p0_1'                }             0             0       0.10404            1       0.11208        0.1034             0               0                0              0             0       0.071805      -0.89715 
    {'p1'                  }             0             0       0.18515            1       0.20327       0.17983             0               0                0              0             0       0.098913      -0.87632 
    {'p5'                  }             0             0       0.27323            1       0.26924       0.24742             0               0                0              0             0        0.11316      -0.55668 
    {'p10'                 }             0    0.00051498       0.35662            1       0.34663       0.30438             0               0                0              0             0        0.12645      -0.28938 
    {'p20'                 }      0.064373      0.083002       0.49455            1       0.49947       0.41077             0               0        0.0026411        0.64562             0        0.14591      0.089704 
    {'p25'                 }       0.17664       0.20935       0.56067            1       0.57738       0.47063       0.28106               0        0.0067149        0.76513             0        0.15354       0.12767 
    {'p30'                 }       0.37542       0.39434       0.62765            1       0.65537       0.52838       0.37421               0         0.012816        0.82574             0        0.16011       0.14393 
    {'p40'                 }       0.88989       0.90689       0.76677            2       0.82916       0.65292       0.52794               0         0.029566        0.89607             0        0.17194       0.16376 
    {'p50'                 }        1.7381        1.6906       0.91665            2        1.0312        0.8006       0.68288               0         0.054027        0.93893             0        0.18233       0.17779 
    {'p60'                 }        3.0034        2.8912        1.0828            2        1.2832       0.98455       0.85118          0.1002         0.089573        0.96712             0        0.19206       0.18942 
    {'p70'                 }        4.7693        4.7054        1.2762            3        1.6179        1.2279        1.0805         0.26236          0.13973        0.98555             0        0.20154       0.20008 
    {'p75'                 }        5.4836        5.9044        1.3916            3        1.8375        1.3881        1.2168         0.35911           0.1741        0.99223             0        0.20634       0.20534 
    {'p80'                 }        7.1191        7.4694        1.5274            4        2.1165        1.5859        1.3913         0.45945           0.2187        0.99687      0.079765        0.21134       0.21073 
    {'p90'                 }         12.56        12.521        1.9354            5        3.0585        2.2533        1.9622         0.88325          0.39107              1       0.43585         0.2227       0.22249 
    {'p95'                 }        16.875        17.769        2.3449            5        4.0476        2.9937        2.5935          1.9998          0.54752              1       0.68492        0.22979       0.22962 
    {'p99'                 }        30.548        31.792        3.4017            6        6.9072        5.0375        4.2881          3.3624          0.74727              1       0.98018        0.24005       0.23995 
    {'p99_9'               }        56.953        57.866        5.2893            6        14.815        8.8678        7.4575          12.834          0.86028              1             1        0.24896       0.24896 
    {'p99_99'              }        90.439        90.717        7.5592            6        21.023        13.702        11.644          17.794          0.91481              1             1        0.25148       0.25148 
    {'fl_cov_a_ss'         }        47.329        47.318         3.476       -1.478        4.5793        3.9427        1.8957         0.63663          0.80041       -0.80811      0.007703        0.10041       0.09271 
    {'fl_cor_a_ss'         }             1       0.99439       0.72826     -0.14945       0.45389       0.56573       0.29692        0.096963           0.6619       -0.34878     0.0049412        0.40929      0.054578 
    {'fl_cov_ap_ss'        }        47.318        47.844        3.5799      -1.4406        5.4304        4.2301         2.208          1.2003          0.75231       -0.71978      -0.03253        0.11154       0.14407 
    {'fl_cor_ap_ss'        }       0.99439             1       0.74597     -0.14488       0.53534       0.60369       0.34397         0.18183          0.61877       -0.30898     -0.020754        0.45221      0.084358 
    {'fl_cov_cons_ss'      }         3.476        3.5799       0.48135      0.23978        0.7718        0.5704       0.43323          0.2014          0.03747     -0.0042544     -0.033215       0.018848      0.052063 
    {'fl_cor_cons_ss'      }       0.72826       0.74597             1      0.24042       0.75854       0.81157       0.67286         0.30417          0.30725      -0.018207      -0.21127        0.76179       0.30392 
    {'fl_cov_n_ss'         }        -1.478       -1.4406       0.23978       2.0664       0.36196       0.09459       0.19345         0.26737        -0.072581        0.17131     -0.098733       0.013683       0.11242 
    {'fl_cor_n_ss'         }      -0.14945      -0.14488       0.24042            1        0.1717      0.064956       0.14501         0.19489         -0.28725        0.35386       -0.3031        0.26692       0.31672 
    {'fl_cov_y_all'        }        4.5793        5.4304        0.7718      0.36196        2.1507        1.1331       0.98441          1.0177        -0.014203        0.10973     -0.095531       0.039306       0.13484 
    {'fl_cor_y_all'        }       0.45389       0.53534       0.75854       0.1717             1       0.76267        0.7233          0.7271        -0.055097        0.22217      -0.28746        0.75157       0.37237 
    {'fl_cov_y_head_inc'   }        3.9427        4.2301        0.5704      0.09459        1.1331        1.0262       0.89528         0.10683        0.0035862       0.064337     -0.067923       0.025209      0.093132 
    {'fl_cor_y_head_inc'   }       0.56573       0.60369       0.81157     0.064956       0.76267             1       0.95229          0.1105          0.02014        0.18857      -0.29589        0.69781       0.37233 
    {'fl_cov_y_head_earn'  }        1.8957         2.208       0.43323      0.19345       0.98441       0.89528       0.86126        0.089134        -0.039646        0.12593     -0.086287       0.022414        0.1087 
    {'fl_cor_y_head_earn'  }       0.29692       0.34397       0.67286      0.14501        0.7233       0.95229             1         0.10064         -0.24304        0.40291      -0.41031        0.67725       0.47437 
    {'fl_cov_y_spouse_inc' }       0.63663        1.2003        0.2014      0.26737        1.0177       0.10683      0.089134         0.91083        -0.017789       0.045397     -0.027608       0.014097      0.041705 
    {'fl_cor_y_spouse_inc' }      0.096963       0.18183       0.30417      0.19489        0.7271        0.1105       0.10064               1         -0.10604        0.14124      -0.12766         0.4142       0.17698 
    {'fl_cov_yshr_interest'}       0.80041       0.75231       0.03747    -0.072581     -0.014203     0.0035862     -0.039646       -0.017789         0.030897      -0.046487      0.015591    -6.1614e-05     -0.015653 
    {'fl_cor_yshr_interest'}        0.6619       0.61877       0.30725     -0.28725     -0.055097       0.02014      -0.24304        -0.10604                1       -0.78527       0.39143     -0.0098294      -0.36065 
    {'fl_cov_yshr_wage'    }      -0.80811      -0.71978    -0.0042544      0.17131       0.10973      0.064337       0.12593        0.045397        -0.046487        0.11343      -0.06694      0.0042342      0.071175 
    {'fl_cor_yshr_wage'    }      -0.34878      -0.30898     -0.018207      0.35386       0.22217       0.18857       0.40291         0.14124         -0.78527              1      -0.87712        0.35255       0.85589 
    {'fl_cov_yshr_SS'      }      0.007703      -0.03253     -0.033215    -0.098733     -0.095531     -0.067923     -0.086287       -0.027608         0.015591       -0.06694      0.051349     -0.0041726     -0.055522 
    {'fl_cor_yshr_SS'      }     0.0049412     -0.020754      -0.21127      -0.3031      -0.28746      -0.29589      -0.41031        -0.12766          0.39143       -0.87712             1       -0.51635      -0.99232 
    {'fl_cov_yshr_tax'     }       0.10041       0.11154      0.018848     0.013683      0.039306      0.025209      0.022414        0.014097      -6.1614e-05      0.0042342    -0.0041726      0.0012717     0.0054443 
    {'fl_cor_yshr_tax'     }       0.40929       0.45221       0.76179      0.26692       0.75157       0.69781       0.67725          0.4142       -0.0098294        0.35255      -0.51635              1       0.61831 
    {'fl_cov_yshr_nttxss'  }       0.09271       0.14407      0.052063      0.11242       0.13484      0.093132        0.1087        0.041705        -0.015653       0.071175     -0.055522      0.0054443      0.060966 
    {'fl_cor_yshr_nttxss'  }      0.054578      0.084358       0.30392      0.31672       0.37237       0.37233       0.47437         0.17698         -0.36065        0.85589      -0.99232        0.61831             1 
    {'fracByP0_01'         }             0             0    5.4726e-06      0.15286    4.2573e-06    5.2131e-06             0               0                0              0             0     2.8386e-05     -0.051713 
    {'fracByP0_1'          }             0             0    8.2626e-05      0.15286    6.3235e-05    7.7569e-05             0               0                0              0             0     0.00035854     -0.051713 
    {'fracByP1'            }             0             0     0.0013773      0.15286     0.0010873     0.0013113             0               0                0              0             0      0.0048507      -0.11699 
    {'fracByP5'            }             0             0      0.010075      0.15286     0.0076055     0.0094768             0               0                0              0             0        0.02883      -0.46646 
    {'fracByP10'           }             0    1.8925e-07      0.024991      0.15286      0.018124      0.022842             0               0                0              0             0       0.062514      -0.71714 
    {'fracByP20'           }    0.00071111     0.0007016      0.065093      0.15286         0.047      0.055458             0               0       0.00070705       0.036059             0        0.13924      -0.82936 
    {'fracByP25'           }     0.0023543     0.0022849      0.089893      0.15286      0.065314      0.076507      0.011684               0        0.0024473       0.082214             0        0.18121      -0.75963 
    {'fracByP30'           }     0.0065355     0.0056773       0.11782      0.15286      0.086292      0.096841      0.030168               0        0.0062059        0.13376             0        0.22517       -0.6753 
    {'fracByP40'           }      0.023222      0.019937        0.1833      0.40183        0.1368        0.1495      0.080999               0         0.022256         0.2454             0        0.31837      -0.48446 
    {'fracByP50'           }      0.057104      0.048358       0.26234      0.40183       0.20002       0.21496        0.1488               0         0.054106        0.36413             0        0.41773      -0.27326 
    {'fracByP60'           }       0.11454      0.098974       0.35614      0.40183       0.27863       0.29527       0.23502        0.012673          0.10916        0.48739             0        0.52273      -0.04639 
    {'fracByP70'           }        0.2027       0.18293       0.46671      0.56321       0.37699        0.3946       0.34392        0.062275          0.19743        0.61361             0         0.6331        0.1941 
    {'fracByP75'           }       0.23918       0.24222       0.52936      0.56321       0.43577        0.4535       0.40836         0.10534          0.25844         0.6775             0        0.69028       0.31924 
    {'fracByP80'           }       0.32171       0.31675       0.59788      0.75407       0.50297       0.52044       0.48157         0.16263          0.33449         0.7418    0.00087521        0.74883       0.44766 
    {'fracByP90'           }       0.55921       0.53294       0.75856       0.8953       0.67532       0.68972       0.66665         0.32833          0.57087              1       0.28391        0.87042       0.71492 
    {'fracByP95'           }       0.69427       0.69899       0.85803       0.8953       0.79442       0.80585       0.79244         0.52547          0.74007              1       0.57844        0.93381       0.85436 
    {'fracByP99'           }       0.90202        0.9039       0.96048            1       0.93109        0.9399       0.93633         0.80928          0.93773              1        0.8997         0.9863       0.96984 
    {'fracByP99_9'         }        0.9849       0.98396       0.99413            1         0.988       0.99015       0.98962         0.95801          0.99314              1             1         0.9986       0.99691 
    {'fracByP99_99'        }       0.99794       0.99764       0.99921            1       0.99841       0.99857       0.99849         0.99466          0.99928              1             1        0.99986       0.99969 

% [Phi_true,Phi_adj] = snw_ds_main(mp_params, mp_controls);
Phi_true = Phi_true/sum(Phi_true(:));

1.2 Show All Info in mp_dsvfi_results

mp_cl_mt_xyz_of_s = mp_dsvfi_results('mp_cl_mt_xyz_of_s');
disp(mp_cl_mt_xyz_of_s('tb_outcomes'))

                       mean      unweighted_sum       sd       coefofvar     gini        min         max       pYis0       pYls0      pYgr0      pYisMINY      pYisMAXY      p0_01        p0_1         p1          p5          p10           p20          p25         p30         p40         p50         p60         p70        p75        p80         p90        p95        p99       p99_9     p99_99     fl_cov_a_ss    fl_cor_a_ss    fl_cov_ap_ss    fl_cor_ap_ss    fl_cov_cons_ss    fl_cor_cons_ss    fl_cov_n_ss    fl_cor_n_ss    fl_cov_y_all    fl_cor_y_all    fl_cov_y_head_inc    fl_cor_y_head_inc    fl_cov_y_head_earn    fl_cor_y_head_earn    fl_cov_y_spouse_inc    fl_cor_y_spouse_inc    fl_cov_yshr_interest    fl_cor_yshr_interest    fl_cov_yshr_wage    fl_cor_yshr_wage    fl_cov_yshr_SS    fl_cor_yshr_SS    fl_cov_yshr_tax    fl_cor_yshr_tax    fl_cov_yshr_nttxss    fl_cor_yshr_nttxss    fracByP0_01    fracByP0_1    fracByP1     fracByP5     fracByP10     fracByP20     fracByP25    fracByP30    fracByP40    fracByP50    fracByP60    fracByP70    fracByP75    fracByP80     fracByP90    fracByP95    fracByP99    fracByP99_9    fracByP99_99
                     ________    ______________    ________    _________    _______    ________    _______    ________    _______    _______    __________    __________    ________    ________    ________    ________    __________    _________    _________    ________    ________    ________    ________    _______    _______    ________    _______    _______    _______    _______    _______    ___________    ___________    ____________    ____________    ______________    ______________    ___________    ___________    ____________    ____________    _________________    _________________    __________________    __________________    ___________________    ___________________    ____________________    ____________________    ________________    ________________    ______________    ______________    _______________    _______________    __________________    __________________    ___________    __________    _________    _________    __________    __________    _________    _________    _________    _________    _________    _________    _________    __________    _________    _________    _________    ___________    ____________

    a_ss               4.3602            2228        6.8796      1.5778      0.6755           0        135     0.11808          0    0.88192       0.11808    6.8049e-06           0           0           0           0             0     0.064373      0.17664     0.37542     0.88989      1.7381      3.0034     4.7693     5.4836      7.1191      12.56     16.875     30.548     56.953     90.439       47.329               1         47.318         0.99439             3.476          0.72826           -1.478      -0.14945          4.5793         0.45389             3.9427             0.56573                1.8957               0.29692                0.63663              0.096963                  0.80041                  0.6619              -0.80811           -0.34878            0.007703        0.0049412             0.10041           0.40929             0.09271              0.054578                  0              0            0            0             0    0.00071111    0.0023543    0.0065355    0.023222     0.057104      0.11454       0.2027      0.23918        0.32171     0.55921      0.69427      0.90202        0.9849        0.99794   
    ap_ss              4.4621      5.3216e+08        6.9169      1.5501     0.67638           0     163.73    0.097968          0    0.90203      0.097968    2.2836e-12           0           0           0           0    0.00051498     0.083002      0.20935     0.39434     0.90689      1.6906      2.8912     4.7054     5.9044      7.4694     12.521     17.769     31.792     57.866     90.717       47.318         0.99439         47.844               1            3.5799          0.74597          -1.4406      -0.14488          5.4304         0.53534             4.2301             0.60369                 2.208               0.34397                 1.2003               0.18183                  0.75231                 0.61877              -0.71978           -0.30898            -0.03253        -0.020754             0.11154           0.45221             0.14407              0.084358                  0              0            0            0    1.8925e-07     0.0007016    0.0022849    0.0056773    0.019937     0.048358     0.098974      0.18293      0.24222        0.31675     0.53294      0.69899       0.9039       0.98396        0.99764   
    cons_ss            1.0635      5.0787e+07        0.6938     0.65237     0.33936    0.036717     141.61           0          0          1    8.6094e-07             0    0.066342     0.10404     0.18515     0.27323       0.35662      0.49455      0.56067     0.62765     0.76677     0.91665      1.0828     1.2762     1.3916      1.5274     1.9354     2.3449     3.4017     5.2893     7.5592        3.476         0.72826         3.5799         0.74597           0.48135                1          0.23978       0.24042          0.7718         0.75854             0.5704             0.81157               0.43323               0.67286                 0.2014               0.30417                  0.03747                 0.30725            -0.0042544          -0.018207           -0.033215         -0.21127            0.018848           0.76179            0.052063               0.30392         5.4726e-06     8.2626e-05    0.0013773     0.010075      0.024991      0.065093     0.089893      0.11782      0.1833      0.26234      0.35614      0.46671      0.52936        0.59788     0.75856      0.85803      0.96048       0.99413        0.99921   
    n_ss               2.3554              21        1.4375     0.61029      0.3128           1          6           0          0          1       0.36005      0.041101           1           1           1           1             1            1            1           1           2           2           2          3          3           4          5          5          6          6          6       -1.478        -0.14945        -1.4406        -0.14488           0.23978          0.24042           2.0664             1         0.36196          0.1717            0.09459            0.064956               0.19345               0.14501                0.26737               0.19489                -0.072581                -0.28725               0.17131            0.35386           -0.098733          -0.3031            0.013683           0.26692             0.11242               0.31672            0.15286        0.15286      0.15286      0.15286       0.15286       0.15286      0.15286      0.15286     0.40183      0.40183      0.40183      0.56321      0.56321        0.75407      0.8953       0.8953            1             1              1   
    y_all              1.4661      8.3558e+07        1.4665      1.0003     0.44546    0.038108     50.873           0          0          1    8.6094e-07    2.2836e-12    0.069931     0.11208     0.20327     0.26924       0.34663      0.49947      0.57738     0.65537     0.82916      1.0312      1.2832     1.6179     1.8375      2.1165     3.0585     4.0476     6.9072     14.815     21.023       4.5793         0.45389         5.4304         0.53534            0.7718          0.75854          0.36196        0.1717          2.1507               1             1.1331             0.76267               0.98441                0.7233                 1.0177                0.7271                -0.014203               -0.055097               0.10973            0.22217           -0.095531         -0.28746            0.039306           0.75157             0.13484               0.37237         4.2573e-06     6.3235e-05    0.0010873    0.0076055      0.018124         0.047     0.065314     0.086292      0.1368      0.20002      0.27863      0.37699      0.43577        0.50297     0.67532      0.79442      0.93109         0.988        0.99841   
    y_head_inc         1.1081      1.9253e+06         1.013     0.91419     0.42164    0.038108     24.357           0          0          1    1.2258e-06     1.694e-09    0.065666      0.1034     0.17983     0.24742       0.30438      0.41077      0.47063     0.52838     0.65292      0.8006     0.98455     1.2279     1.3881      1.5859     2.2533     2.9937     5.0375     8.8678     13.702       3.9427         0.56573         4.2301         0.60369            0.5704          0.81157          0.09459      0.064956          1.1331         0.76267             1.0262                   1               0.89528               0.95229                0.10683                0.1105                0.0035862                 0.02014              0.064337            0.18857           -0.067923         -0.29589            0.025209           0.69781            0.093132               0.37233         5.2131e-06     7.7569e-05    0.0013113    0.0094768      0.022842      0.055458     0.076507     0.096841      0.1495      0.21496      0.29527       0.3946       0.4535        0.52044     0.68972      0.80585       0.9399       0.99015        0.99857   
    y_head_earn       0.88655           19732       0.92804      1.0468     0.53121           0     18.957      0.2016          0     0.7984        0.2016    1.2258e-07           0           0           0           0             0            0      0.28106     0.37421     0.52794     0.68288     0.85118     1.0805     1.2168      1.3913     1.9622     2.5935     4.2881     7.4575     11.644       1.8957         0.29692          2.208         0.34397           0.43323          0.67286          0.19345       0.14501         0.98441          0.7233            0.89528             0.95229               0.86126                     1               0.089134               0.10064                -0.039646                -0.24304               0.12593            0.40291           -0.086287         -0.41031            0.022414           0.67725              0.1087               0.47437                  0              0            0            0             0             0     0.011684     0.030168    0.080999       0.1488      0.23502      0.34392      0.40836        0.48157     0.66665      0.79244      0.93633       0.98962        0.99849   
    y_spouse_inc      0.35797       4.827e+05       0.95437      2.6661     0.85269           0     26.627     0.52499          0    0.47501       0.52499    1.9415e-10           0           0           0           0             0            0            0           0           0           0      0.1002    0.26236    0.35911     0.45945    0.88325     1.9998     3.3624     12.834     17.794      0.63663        0.096963         1.2003         0.18183            0.2014          0.30417          0.26737       0.19489          1.0177          0.7271            0.10683              0.1105              0.089134               0.10064                0.91083                     1                -0.017789                -0.10604              0.045397            0.14124           -0.027608         -0.12766            0.014097            0.4142            0.041705               0.17698                  0              0            0            0             0             0            0            0           0            0     0.012673     0.062275      0.10534        0.16263     0.32833      0.52547      0.80928       0.95801        0.99466   
    yshr_interest     0.12865      3.8438e+06       0.17577      1.3663     0.65781           0    0.99299     0.11808          0    0.88192       0.11808             0           0           0           0           0             0    0.0026411    0.0067149    0.012816    0.029566    0.054027    0.089573    0.13973     0.1741      0.2187    0.39107    0.54752    0.74727    0.86028    0.91481      0.80041          0.6619        0.75231         0.61877           0.03747          0.30725        -0.072581      -0.28725       -0.014203       -0.055097          0.0035862             0.02014             -0.039646              -0.24304              -0.017789              -0.10604                 0.030897                       1             -0.046487           -0.78527            0.015591          0.39143         -6.1614e-05        -0.0098294           -0.015653              -0.36065                  0              0            0            0             0    0.00070705    0.0024473    0.0062059    0.022256     0.054106      0.10916      0.19743      0.25844        0.33449     0.57087      0.74007      0.93773       0.99314        0.99928   
    yshr_wage         0.77402      8.8881e+06       0.33679     0.43512      0.2062           0          1     0.10584          0    0.89416       0.10584        0.1117           0           0           0           0             0      0.64562      0.76513     0.82574     0.89607     0.93893     0.96712    0.98555    0.99223     0.99687          1          1          1          1          1     -0.80811        -0.34878       -0.71978        -0.30898        -0.0042544        -0.018207          0.17131       0.35386         0.10973         0.22217           0.064337             0.18857               0.12593               0.40291               0.045397               0.14124                -0.046487                -0.78527               0.11343                  1            -0.06694         -0.87712           0.0042342           0.35255            0.071175               0.85589                  0              0            0            0             0      0.036059     0.082214      0.13376      0.2454      0.36413      0.48739      0.61361       0.6775         0.7418           1            1            1             1              1   
    yshr_SS          0.097329           29012        0.2266      2.3282     0.91382           0          1      0.7984          0     0.2016        0.7984      0.005851           0           0           0           0             0            0            0           0           0           0           0          0          0    0.079765    0.43585    0.68492    0.98018          1          1     0.007703       0.0049412       -0.03253       -0.020754         -0.033215         -0.21127        -0.098733       -0.3031       -0.095531        -0.28746          -0.067923            -0.29589             -0.086287              -0.41031              -0.027608              -0.12766                 0.015591                 0.39143              -0.06694           -0.87712            0.051349                1          -0.0041726          -0.51635           -0.055522              -0.99232                  0              0            0            0             0             0            0            0           0            0            0            0            0     0.00087521     0.28391      0.57844       0.8997             1              1   
    yshr_tax          0.17833      2.8338e+06      0.035661     0.19998     0.11386    0.036506     0.2552           0          0          1    8.6094e-07    2.2836e-12    0.054112    0.071805    0.098913     0.11316       0.12645      0.14591      0.15354     0.16011     0.17194     0.18233     0.19206    0.20154    0.20634     0.21134     0.2227    0.22979    0.24005    0.24896    0.25148      0.10041         0.40929        0.11154         0.45221          0.018848          0.76179         0.013683       0.26692        0.039306         0.75157           0.025209             0.69781              0.022414               0.67725               0.014097                0.4142              -6.1614e-05              -0.0098294             0.0042342            0.35255          -0.0041726         -0.51635           0.0012717                 1           0.0054443               0.61831         2.8386e-05     0.00035854    0.0048507      0.02883      0.062514       0.13924      0.18121      0.22517     0.31837      0.41773      0.52273       0.6331      0.69028        0.74883     0.87042      0.93381       0.9863        0.9986        0.99986   
    yshr_nttxss      0.080996      2.8048e+06       0.24691      3.0485      1.2592    -0.89715     0.2552           0    0.17487    0.82513     0.0046688    2.2836e-12    -0.89715    -0.89715    -0.87632    -0.55668      -0.28938     0.089704      0.12767     0.14393     0.16376     0.17779     0.18942    0.20008    0.20534     0.21073    0.22249    0.22962    0.23995    0.24896    0.25148      0.09271        0.054578        0.14407        0.084358          0.052063          0.30392          0.11242       0.31672         0.13484         0.37237           0.093132             0.37233                0.1087               0.47437               0.041705               0.17698                -0.015653                -0.36065              0.071175            0.85589           -0.055522         -0.99232           0.0054443           0.61831            0.060966                     1          -0.051713      -0.051713     -0.11699     -0.46646      -0.71714      -0.82936     -0.75963      -0.6753    -0.48446     -0.27326     -0.04639       0.1941      0.31924        0.44766     0.71492      0.85436      0.96984       0.99691        0.99969   

1.3 Show Distribution by Age

Note that the age-distribution is exogenously determined by the age-specific survival rate. From: "load(‘Mortality_prob_by_age_18_99.mat’,‘mort_prob’) psi_full=1-mort_prob;".

First, we generate a vector for the age-specific mass, and visualize this.

ar_fl_phi_true_age = NaN([size(Phi_true,1),1]);
for it_age_ctr=1:size(Phi_true,1)
  ar_fl_phi_true_age(it_age_ctr,1) = sum(Phi_true(it_age_ctr,:));
end
ar_ages = 18:(18+size(Phi_true,1)-1);
% Graph
figure();
h1 = scatter(ar_ages, ar_fl_phi_true_age);
grid on;
legend1 = sprintf('Distribution of individuals across age groups');
legend({legend1});
xlabel("Ages");

Second, given some overall age span from age Xl to Xu, we consider G segments within, and the conditional probability of mass in each of the G segments within Xl to Xu bounds.

% Overall prime-age
it_age_min = 18;
it_age_max = 65;
ar_ages_18t65 = ((ar_ages<=it_age_max) & (ar_ages>=it_age_min));
ar_fl_phi_true_age_18t65 = ar_fl_phi_true_age(ar_ages_18t65);
fl_total_mass_18t65 = sum(ar_fl_phi_true_age_18t65);
% Sub-segments
ar_it_lower = [18, 25, 55]';
ar_it_higher = [24, 54, 65]';
ar_fl_p_agegrp_condi_18t65 = NaN([length(ar_it_lower),1]);
for it_age_ctr=1:length(ar_it_lower)
  it_age_lower = ar_it_lower(it_age_ctr);
  it_age_higher = ar_it_higher(it_age_ctr);
  ar_ages_subgrp = ((ar_ages<=it_age_higher) & (ar_ages>=it_age_lower));
  ar_fl_phi_true_age_subgrp = ar_fl_phi_true_age(ar_ages_subgrp);
  ar_fl_p_agegrp_condi_18t65(it_age_ctr) = sum(ar_fl_phi_true_age_subgrp)/fl_total_mass_18t65;
end
disp(['sum of ar_fl_p_agegrp_condi_18t65=' num2str(sum(ar_fl_p_agegrp_condi_18t65))]);

sum of ar_fl_p_agegrp_condi_18t65=1

disp(table(ar_fl_p_agegrp_condi_18t65, ar_it_lower, ar_it_higher));

    ar_fl_p_agegrp_condi_18t65    ar_it_lower    ar_it_higher
    __________________________    ___________    ____________

             0.18278                  18              24     
             0.64041                  25              54     
             0.17681                  55              65