1 Distribution with One Period Policy Shift

This is the example vignette for function: snw_ds_main_vec from the PrjOptiSNW Package.

1.1 One-period Deviation from Steady-State given Alternative Policy Function

In addition to solving for distribution given one policy function, snw_ds_main_vec can also solve for the distributional shift from "steady-state" with a one-period policy shift.

If a 6th parameter, PHI_ADJ_BASE, is provided to snw_ds_main_vec, solve for next-period forward distribution conditional on PHI_ADJ_BASE, using the policy function provided to snw_ds_main_vec as the 3rd and 4th parameters.

When PHI_ADJ_BASE is provided, if the AP_SS, CONS_SS policy functions inputs are from the same problem that generated PHI_ADJ_BASE, output PHI_ADJ will be identical to PHI_ADJ_BASE. However, if AP_SS, CONS_SS are different policy functions from those that induced PHI_ADJ_BASE, PHI_ADJ output will be different from PHI_ADJ_BASE input.

This allows for obtaining the distributional impact of a one period policy, allowing for deviation from "steady-state" distribution. This is used to solve for the distribution after one-period MIT shock, given stimulus checks provided in that period.

This is used to model the distributional effects of CARES Act, the two rounds of Trump Stimulus Checks, on household asset distribution when then receive the Biden stimulus checks from the the American Recovery Act. In effect, we have two MIT shock periods.

1.2 Solve for "Steady-State" Policy and Value Functions

Steady-state policy and value functions

% mp_params = snw_mp_param('default_dense');
mp_params = snw_mp_param('default_docdense');
% mp_params = snw_mp_param('default_moredense_a65zh133zs5_e2m2');
mp_controls = snw_mp_control('default_test');
mp_controls('bl_print_vfi') = false;
mp_controls('bl_print_vfi_verbose') = false;
mp_controls('bl_print_ds') = false;
mp_controls('bl_print_ds_verbose') = false;
[V_ss,ap_ss,cons_ss,mp_valpol_more_ss] = snw_vfi_main_bisec_vec(mp_params, mp_controls);

Completed SNW_VFI_MAIN_BISEC_VEC;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;time=550.0624

1.3 Solve for "Steady-State" Distribution

Solve for steady-state distributions, using steady-state policy functions.

[Phi_true_ss,Phi_adj_ss,A_agg_ss,Y_inc_agg_ss,~,mp_dsvfi_results_ss] = ...
    snw_ds_main_vec(mp_params, mp_controls, ap_ss, cons_ss);

Completed SNW_VFI_MAIN_BISEC_VEC;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;time=547.3022
Completed SNW_DS_MAIN_VEC;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;time=1786.6361

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

Show distributional results.

mp_cl_mt_xyz_of_s = mp_dsvfi_results_ss('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.4 Solve for Policy Function Under Trump Stimulus

Same continuation value as prior (steady-state continuation), but now solve for new policy (one round) due to Trump stimulus. Same tax rate in covid and other years, manna-from-heaven. This calls the snw_vfi_main_bisec_vec_stimulus function, which provides the stimulus checks as a function of income and family status.

mp_params('a2_covidyr') = mp_params('a2_covidyr_manna_heaven');
[~,ap_trumpchecks,cons_trumpchecks, mp_valpol_more_trumpchecks] = ...
    snw_vfi_main_bisec_vec_stimulus(mp_params, mp_controls, V_ss);

Completed SNW_VFI_MAIN_BISEC_VEC 1 Period Unemp Shock;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;time=557.2826

1.5 Solve for Updated Distribution given Trump Stimulus

Fixing mass at their steady-state distribution, policy functions shift to the Trump stimulus policies, resolve for one-period forward distribution. The distributional code is almost identical, except uses steady-state distribution as the "base" distribution via parameter PHI_ADJ_SS.

[Phi_true_trumpchecks,Phi_adj_trumpchecks,...
    A_agg_trumpchecks,Y_inc_agg_trumpchecks,~,mp_dsvfi_results_trumpchecks] = snw_ds_main_vec(...
    mp_params, mp_controls, ...
    ap_trumpchecks, cons_trumpchecks, ...
    mp_valpol_more_trumpchecks, ...
    Phi_adj_ss);

Completed SNW_DS_MAIN_VEC;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;time=1546.0593

Phi_true_trumpchecks = Phi_true_trumpchecks/sum(Phi_true_trumpchecks(:));

Show distributional results.

mp_cl_mt_xyz_of_s = mp_dsvfi_results_trumpchecks('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.3988            2228        6.8731      1.5625     0.66733           0        135     0.034387          0    0.96561      0.034387    6.8049e-06           0           0            0      0.013905     0.032959      0.11124      0.17664     0.37542     0.88989      1.7381      3.0034     4.7693     5.4836      7.1191      12.56     18.507     32.959     56.953     90.439        47.239              1         47.194         0.99451            3.4368          0.72502          -1.4518      -0.14694          4.5719         0.45363              3.932             0.56492                1.8886               0.29608                0.63998              0.097565                   0.7955                0.65987               -0.80304           -0.34757           0.0075469        0.0048626             0.10023           0.40968            0.092678              0.054794                  0              0             0    9.9393e-05    0.00053555     0.002329    0.0035163    0.0078383     0.02513     0.059999       0.11789     0.20613      0.24258        0.32495     0.56167      0.73577      0.91953       0.98503        0.99796   
    ap_ss              4.5367       5.326e+08        6.9044      1.5219     0.66162           0     163.73    0.0090623          0    0.99094     0.0090623    2.2836e-12           0           0    0.0041199      0.034414     0.064373      0.17234      0.30454     0.50189      1.0173       1.778      2.9959     4.7693     5.9677      7.5277      12.56     17.823     31.811     57.868     90.717        47.194        0.99451         47.671               1            3.5381          0.74301           -1.391      -0.14015          5.4122         0.53457             4.2111             0.60227                 2.194               0.34241                 1.2012               0.18229                  0.74714                0.61694               -0.71401           -0.30763           -0.033122        -0.021244             0.11132           0.45297             0.14444              0.085011                  0              0    3.3566e-07    0.00021098    0.00081793    0.0031715    0.0056981     0.010145    0.026481     0.056608        0.1083     0.19258      0.25176        0.32572     0.53969      0.70369      0.90551       0.98423        0.99768   
    cons_ss            1.0761      5.0871e+07       0.68968     0.64091     0.33326    0.048012     141.61            0          0          1             0             0    0.084007     0.12353      0.20601       0.28992      0.37248      0.51004      0.57644     0.64337     0.78203     0.93074      1.0951     1.2874      1.402      1.5361     1.9422     2.3481     3.4022     5.2902     7.5592        3.4368        0.72502         3.5381         0.74301           0.47566                1          0.25317       0.25536         0.76547         0.75689            0.56543             0.80958               0.43005                0.6719                0.20004               0.30392                  0.03594                 0.2971             -0.0024993           -0.01078            -0.03344         -0.21472            0.018663           0.76024            0.052104               0.30699         6.9424e-06     9.7907e-05     0.0015541      0.010856      0.026295     0.067432     0.092662      0.12099     0.18715      0.26663       0.36064       0.471       0.5334        0.60156      0.7611      0.85962      0.96093       0.99419        0.99922   
    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.4518       -0.14694         -1.391        -0.14015           0.25317          0.25536           2.0664             1         0.36301         0.17221           0.095638            0.065699               0.19345               0.14501                0.26737               0.19489                -0.071884                -0.2851                0.17031            0.35244           -0.098425         -0.30321            0.013707           0.26789             0.11213               0.31698            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.4676      8.3558e+07        1.4664     0.99915     0.44498    0.038108     50.873            0          0          1    2.9018e-07    2.2836e-12     0.07106     0.11263      0.20454       0.27056       0.3493      0.50134      0.57928     0.65752     0.83104      1.0327      1.2852     1.6199      1.839      2.1178     3.0596     4.0486     6.9075     14.816     21.023        4.5719        0.45363         5.4122         0.53457           0.76547          0.75689          0.36301       0.17221          2.1503               1             1.1325             0.76263               0.98412               0.72316                 1.0178               0.72727                -0.015345              -0.059663                0.11057             0.2243           -0.095222         -0.28757            0.039237           0.75173             0.13446                0.3726         4.2337e-06     6.4292e-05     0.0010941     0.0076783      0.018183     0.047117     0.065468     0.086485     0.13705      0.20034         0.279     0.37737      0.43615        0.50334     0.67559      0.79461      0.93115       0.98801        0.99841   
    y_head_inc         1.1097      1.9253e+06        1.0127      0.9126     0.42095    0.038108     24.357            0          0          1      5.74e-07     1.694e-09    0.066852     0.10477      0.18103       0.24977      0.30438      0.41077      0.47063     0.52934     0.65515     0.80328     0.98738     1.2298       1.39      1.5874     2.2544     2.9939     5.0375     8.8678     13.702         3.932        0.56492         4.2111         0.60227           0.56543          0.80958         0.095638      0.065699          1.1325         0.76263             1.0255                   1               0.89499               0.95232                0.10697               0.11068                0.0027409               0.015431               0.064969            0.19085           -0.067709         -0.29609             0.02516             0.698            0.092869               0.37266           5.29e-06     8.1766e-05     0.0013086     0.0094204      0.022582     0.055107     0.076177     0.096691     0.14989      0.21541       0.29578     0.39517      0.45403        0.52093     0.69012      0.80612      0.93998       0.99016        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.8886        0.29608          2.194         0.34241           0.43005           0.6719          0.19345       0.14501         0.98412         0.72316            0.89499             0.95232               0.86126                     1               0.089134               0.10064                -0.040304                -0.2476                0.12631            0.40489            -0.08601         -0.41042             0.02237            0.6772             0.10838               0.47456                  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.63998       0.097565         1.2012         0.18229           0.20004          0.30392          0.26737       0.19489          1.0178         0.72727            0.10697             0.11068              0.089134               0.10064                0.91083                     1                -0.018086               -0.10804               0.045599            0.14213           -0.027513         -0.12766            0.014077           0.41438             0.04159               0.17708                  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.13035      3.8438e+06        0.1754      1.3457     0.64346           0    0.99299     0.034387          0    0.96561      0.034387             0           0           0            0    0.00082434    0.0025217    0.0056683    0.0092053    0.014964    0.031346    0.055798    0.090978    0.14116    0.17526      0.2199    0.39107    0.54824    0.74845    0.86028    0.91481        0.7955        0.65987        0.74714         0.61694           0.03594           0.2971        -0.071884       -0.2851       -0.015345       -0.059663          0.0027409            0.015431             -0.040304               -0.2476              -0.018086              -0.10804                 0.030765                      1              -0.046387           -0.78673            0.015622          0.39442         -0.00010026         -0.016058           -0.015723              -0.36425                  0              0             0     5.556e-05    0.00078364    0.0037333    0.0065005     0.011071    0.028471     0.061376       0.11695     0.20511      0.26673        0.34133     0.57407      0.74309      0.93856       0.99323        0.99929   
    yshr_wage         0.77264      8.8881e+06       0.33616     0.43508     0.21167           0          1      0.10584          0    0.89416       0.10584      0.033523           0           0            0             0            0      0.64486      0.76442     0.82501     0.89479     0.93737     0.96521    0.98357    0.98988     0.99394    0.99735      0.999          1          1          1      -0.80304       -0.34757       -0.71401        -0.30763        -0.0024993         -0.01078          0.17031       0.35244         0.11057          0.2243           0.064969             0.19085               0.12631               0.40489               0.045599               0.14213                -0.046387               -0.78673                  0.113                  1           -0.066615         -0.87755           0.0042507           0.35525            0.070866               0.85664                  0              0             0             0             0      0.03604     0.082228      0.13382     0.24554       0.3643       0.48756     0.61375      0.67766        0.74182     0.87073      0.93531            1             1              1   
    yshr_SS          0.097017           29012       0.22582      2.3276     0.91391           0          1       0.7984          0     0.2016        0.7984    0.00067295           0           0            0             0            0            0            0           0           0           0           0          0          0    0.079765    0.43585    0.68492    0.98018    0.99938          1     0.0075469      0.0048626      -0.033122       -0.021244          -0.03344         -0.21472        -0.098425      -0.30321       -0.095222        -0.28757          -0.067709            -0.29609              -0.08601              -0.41042              -0.027513              -0.12766                 0.015622                0.39442              -0.066615           -0.87755            0.050993                1          -0.0041504          -0.51636           -0.055143               -0.9923                  0              0             0             0             0            0            0            0           0            0             0           0            0     0.00087879     0.28576      0.58134      0.90618       0.99003              1   
    yshr_tax          0.17842      2.8338e+06      0.035595      0.1995     0.11358    0.036506     0.2552            0          0          1    2.9018e-07    2.2836e-12    0.054654    0.072006     0.099219       0.11342      0.12686       0.1461      0.15371     0.16028     0.17205     0.18239     0.19213    0.20158    0.20637     0.21136    0.22271     0.2298    0.24005    0.24896    0.25148       0.10023        0.40968        0.11132         0.45297          0.018663          0.76024         0.013707       0.26789        0.039237         0.75173            0.02516               0.698               0.02237                0.6772               0.014077               0.41438              -0.00010026              -0.016058              0.0042507            0.35525          -0.0041504         -0.51636            0.001267                 1           0.0054174               0.61846         2.8124e-05     0.00036313     0.0048693      0.029042      0.062614      0.13938      0.18137      0.22536     0.31856      0.41793       0.52292     0.63326      0.69042        0.74895     0.87049      0.93385      0.98631        0.9986        0.99986   
    yshr_nttxss      0.081403      2.8048e+06       0.24609      3.0231       1.249    -0.89715     0.2552            0    0.17479    0.82521    0.00045672    2.2836e-12    -0.89715    -0.89637     -0.87632      -0.55668     -0.28938      0.08986      0.12786      0.1441     0.16389     0.17789     0.18949    0.20013    0.20538     0.21075     0.2225    0.22963    0.23995    0.24896    0.25148      0.092678       0.054794        0.14444        0.085011          0.052104          0.30699          0.11213       0.31698         0.13446          0.3726           0.092869             0.37266               0.10838               0.47456                0.04159               0.17708                -0.015723               -0.36425               0.070866            0.85664           -0.055143          -0.9923           0.0054174           0.61846             0.06056                     1         -0.0050336      -0.023491      -0.10962      -0.45959      -0.70907     -0.82102     -0.75146     -0.66737    -0.47745     -0.26713     -0.041321     0.19805      0.32259        0.45038     0.71633      0.85509      0.96999       0.99693        0.99969   

1.6 Debug Check, SNW_DS_MAIN_VEC with Steady State Policies

This is to confirm that code is working properly. If we use steady-state policy functions and also provide as a sixth parameter the steady-state distribution, PHI_ADJ_SS, to snw_ds_main_vec, we should get back the same distribution, PHI_TRUE_SS_WITH_EXISTDIST_DEBUG, which is the same as PHI_ADJ_SS. See that the distributional outputs at the end of this subsection is the same as the distributional table before the table directly prior.

[Phi_true_ss_with_existdist_debug,~,~,~,~,mp_dsvfi_results_ss_with_existdist_debug] = snw_ds_main_vec(...
    mp_params, mp_controls, ...
    ap_ss, cons_ss, ...
    mp_valpol_more_ss, ...
    Phi_adj_ss);

Completed SNW_DS_MAIN_VEC;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;time=1848.7637

Phi_true_ss_with_existdist_debug = Phi_true_ss_with_existdist_debug/sum(Phi_true_ss_with_existdist_debug(:));

Show distributional results.

mp_cl_mt_xyz_of_s = mp_dsvfi_results_ss_with_existdist_debug('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