This is the example vignette for function: snw_evuvw19_jmky_allchecks from the PrjOptiSNW Package. 2019 integrated over VU and VW
The key features of the Biden stimulus check are: i) determined based on 2020 information; ii) checks received in 2021, ex-post the realization of the second one-time MIT shock, which similar to the first MIT shock, is conditional on income and age groups; iii) state of the economy returns to steady-state in 2022; iv) trump checks were provided in 2020, which changes saves and consumption and distributions in 2020, and appropriate adjustments are made so that the biden check is conditional on the distributional changes in endogenous savings due to the Trump checks.
Save a result that is low in memory cost so that it can be loaded quickly for various allocation tests. Turn off Various Printing Controls. Call function with wide income bins to reduce memory storage and retrievel costs
clear all;
% Start mp contorls
mp_controls = snw_mp_control('default_test');
% Solve for Unemployment Values
mp_controls('bl_timer') = true;
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') = true;
mp_controls('bl_print_precompute') = false;
mp_controls('bl_print_precompute_verbose') = false;
mp_controls('bl_print_a4chk') = false;
mp_controls('bl_print_a4chk_verbose') = false;
mp_controls('bl_print_evuvw20_jaeemk') = false;
mp_controls('bl_print_evuvw20_jaeemk_verbose') = false;
mp_controls('bl_print_evuvw19_jaeemk') = false;
mp_controls('bl_print_evuvw19_jaeemk_verbose') = false;
mp_controls('bl_print_evuvw19_jmky') = false;
mp_controls('bl_print_evuvw19_jmky_verbose') = false;
Dense default, and unemployment parameters:
% default dense load
% mp_params = snw_mp_param('default_dense');
mp_params = snw_mp_param('default_docdense')
mp_params =
Map with properties:
Count: 64
KeyType: char
ValueType: any
mp_params('beta') = 0.95;
fl_scaleconvertor = 62502;
mp_more_inputs('fl_scaleconvertor') = fl_scaleconvertor;
% Unemployment
xi = 0.651; % Proportional reduction in income due to unemployment (xi=0 refers to 0 labor income; xi=1 refers to no drop in labor income)
b=1; % Unemployment insurance replacement rate (b=0 refers to no UI benefits; b=1 refers to 100 percent labor income replacement)
TR=100/fl_scaleconvertor; % Value of a wezlfare check (can receive multiple checks). TO DO: Update with alternative values
mp_params('pi_unemp') = mp_params('pi_unemp_2020_juneadj');
mp_params('xi') = xi;
mp_params('b') = b;
mp_params('TR') = TR;
% Check Count: 89 checks to allow for both the first and the second round
n_welfchecksgrid = 3;
mp_params('n_welfchecksgrid') = n_welfchecksgrid;
mp_params('a2_covidyr') = mp_params('a2_covidyr_manna_heaven');
Income bins:
% Income Grid
% 4 refers to 4*58056=232224 dollars in 2012USD
% max 7 refers to 7*58056=406392 dollars in 2012USD
% all phase out = (4400/5)*100 + 150000 = 238000
% if 500 dollar interval, need 476 inc groups before 238000
% if have 85 percent of points betwen 238000,
fl_max_phaseout = 238000;
fl_multiple = fl_scaleconvertor;
it_bin_dollar_before_phaseout = 5000;
it_bin_dollar_after_phaseout = 25000;
fl_thres = fl_max_phaseout/fl_multiple;
inc_grid1 = linspace(0,fl_thres,(fl_max_phaseout)/it_bin_dollar_before_phaseout);
inc_grid2 = linspace(fl_thres, 7, (7*fl_multiple-fl_max_phaseout)/it_bin_dollar_after_phaseout);
inc_grid=sort(unique([inc_grid1 inc_grid2]'));
mp_params('n_incgrid') = length(inc_grid);
mp_params('inc_grid') = inc_grid;
The simulation here (dense) requires less than 10 GB of memory with 8 workers (8 threads needed), simulating over 88 checks takes with 8 workers
st_biden_or_trump = 'bidenchk';
st_solu_type = 'bisec_vec';
bl_parfor = false;
it_workers = 1;
bl_export = false;
bl_load_mat = false;
snm_suffix = ['_test_ybin' num2str(it_bin_dollar_before_phaseout)];
[ev19_jmky_allchecks, ec19_jmky_allchecks, output] = ...
snw_evuvw19_jmky_allchecks(mp_params, mp_controls, ...
st_biden_or_trump, st_solu_type, ...
bl_parfor, it_workers, ...
bl_export, bl_load_mat, snm_suffix);
Completed SNW_VFI_MAIN_BISEC_VEC;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;time=338.8603
Completed SNW_VFI_MAIN_BISEC_VEC 1 Period Unemp Shock;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;time=330.6944
sum of Phi_adj:83
sum of Phi_true:45.7931
sum of Phiss:83
summ of diff of Phiss and Phi_adj:-3.4939e-12
summ of diff of Phiss and Phi_true:37.2069
Completed SNW_DS_MAIN_VEC;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;time=951.9985
Biden Check, resolve for distributions given Trump check
Completed SNW_VFI_MAIN_BISEC_VEC 1 Period Unemp Shock;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;time=534.8579
sum of Phi_adj:83
sum of Phi_true:45.7931
sum of Phiss:83
summ of diff of Phiss and Phi_adj:-1.0845e-13
summ of diff of Phiss and Phi_true:37.2069
summ of diff of Phi_adj_base and Phiss:1.0838e-13
Completed SNW_DS_MAIN_VEC;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;time=1016.4233
Wage quintile cutoffs=0.4645 0.71528 1.0335 1.5632
Completed SNW_HH_PRECOMPUTE;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;time cost=300.7993
SNW_EVUVW19_JMKY_MASS Start
Completed SNW_EVUVW19_JMKY_MASS;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;time=5.3048
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_outcomes ND Array (Matrix etc)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i idx ndim numel rowN colN sum mean std coefvari min max
_ ___ ____ ________ ____ _________ ______ __________ __________ ________ ___ _________
Phi_true 1 1 6 4.37e+07 83 5.265e+05 45.793 1.0479e-06 1.5158e-05 14.465 0 0.0062366
Phi_true_jmky 2 2 4 43460 82 530 45.787 0.0010535 0.0030972 2.9398 0 0.066875
SNW_EVUVW19_JMKY_ALLCHECKS Start
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Completed SNW_A4CHK_WRK_BISEC_VEC;SNW_MP_PARAM=bidenchk;welf_checks=0;TR=0.0015999;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;time cost=77.8559
Completed SNW_A4CHK_UNEMP_BISEC_VEC;welf_checks=0;TR=0.0015999;xi=0.651;b=1;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;time cost=76.9936
Completed SNW_EVUVW20_JAEEMK;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;timeEUEC=8.3216
Completed SNW_EVUVW19_JAEEMK_FOC;st_biden_or_trump=bidenchk;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;time=15.4896
Completed SNW_EVUVW19_JMKY;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;time=9.5927
SNW_EVUVW19_JMKY_ALLCHECKS: Finished Check 0 of 2, time=190.7959
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Completed SNW_A4CHK_WRK_BISEC_VEC;SNW_MP_PARAM=bidenchk;welf_checks=1;TR=0.0015999;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;time cost=78.1092
Completed SNW_A4CHK_UNEMP_BISEC_VEC;welf_checks=1;TR=0.0015999;xi=0.651;b=1;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;time cost=77.7622
Completed SNW_EVUVW20_JAEEMK;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;timeEUEC=7.7507
Completed SNW_EVUVW19_JAEEMK_FOC;st_biden_or_trump=bidenchk;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;time=15.1776
Completed SNW_EVUVW19_JMKY;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;time=9.57
SNW_EVUVW19_JMKY_ALLCHECKS: Finished Check 1 of 2, time=190.7479
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Completed SNW_A4CHK_WRK_BISEC_VEC;SNW_MP_PARAM=bidenchk;welf_checks=2;TR=0.0015999;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;time cost=78.4265
Completed SNW_A4CHK_UNEMP_BISEC_VEC;welf_checks=2;TR=0.0015999;xi=0.651;b=1;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;time cost=78.0681
Completed SNW_EVUVW20_JAEEMK;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;timeEUEC=7.9871
Completed SNW_EVUVW19_JAEEMK_FOC;st_biden_or_trump=bidenchk;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;time=15.0582
Completed SNW_EVUVW19_JMKY;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;time=9.4891
SNW_EVUVW19_JMKY_ALLCHECKS: Finished Check 2 of 2, time=191.4103
Completed SNW_EVUVW19_JMKY_ALLCHECKS;ST_BIDEN_OR_TRUMP=bidenchk;SNW_MP_PARAM=default_docdense;SNW_MP_CONTROL=default_test;time=4165.4675
----------------------------------------
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CONTAINER NAME: mp_outcomes ND Array (Matrix etc)
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i idx ndim numel rowN colN sum mean std coefvari min max
_ ___ ____ __________ __________ _____ ___________ _______ _______ ________ _________ ______
Output 1 1 2 1.0453e+06 1.1615e+05 9 7.7287e+06 7.3938 18.434 2.4932 -0.57722 99
ec19_jmky_allchecks 2 2 5 1.3038e+05 3 43460 2.7167e+05 2.0836 1.9867 0.95347 0 14.589
ec19_jmky_allchecks_posmass 3 3 2 1.1615e+05 1.1615e+05 1 2.7167e+05 2.339 1.9579 0.83706 0.068495 14.589
ev19_jmky_allchecks 4 4 5 1.3038e+05 3 43460 -2.3026e+06 -17.661 21.876 -1.2387 -317.63 0
ev19_jmky_allchecks_posmass 5 5 2 1.1615e+05 1.1615e+05 1 17652 0.15199 0.24067 1.5835 0.0031484 4.8247
xxx TABLE:Output xxxxxxxxxxxxxxxxxx
c1 c2 c3 c4 c6 c7 c8 c9
__ __ __ __ __________ ________ _________ ________
r1 18 0 0 0 2.1599e-05 -0.57722 0.0053864 0.068495
r2 18 0 0 1 2.1599e-05 -0.57722 0.0053978 0.069683
r3 18 0 0 2 2.1599e-05 -0.57722 0.005409 0.070689
r4 19 0 0 0 1.9002e-05 0.42278 0.0056805 0.075684
r5 19 0 0 1 1.9002e-05 0.42278 0.0056903 0.07644
r116141 86 1 4 1 3.9923e-49 4.2268 0.97814 13.904
r116142 86 1 4 2 3.9923e-49 4.2268 0.97816 13.904
r116143 87 1 4 0 7.923e-63 4.2413 1.071 14.588
r116144 87 1 4 1 7.923e-63 4.2413 1.071 14.588
r116145 87 1 4 2 7.923e-63 4.2413 1.0711 14.589
xxx TABLE:ec19_jmky_allchecks xxxxxxxxxxxxxxxxxx
c1 c2 c3 c4 c43457 c43458 c43459 c43460
________ ________ ________ ________ ______ ______ ______ ______
r1 0.068495 0.075684 0.077039 0.075763 0 0 0 0
r2 0.069683 0.07644 0.077934 0.076696 0 0 0 0
r3 0.070689 0.077196 0.078828 0.077629 0 0 0 0
xxx TABLE:ec19_jmky_allchecks_posmass xxxxxxxxxxxxxxxxxx
c1
________
r1 0.068495
r2 0.069683
r3 0.070689
r4 0.075684
r5 0.07644
r116141 13.904
r116142 13.904
r116143 14.588
r116144 14.588
r116145 14.589
xxx TABLE:ev19_jmky_allchecks xxxxxxxxxxxxxxxxxx
c1 c2 c3 c4 c43457 c43458 c43459 c43460
_______ _______ _______ _______ ______ ______ ______ ______
r1 -185.65 -176.04 -169.67 -170.69 0 0 0 0
r2 -185.26 -175.74 -169.37 -170.39 0 0 0 0
r3 -184.88 -175.43 -169.08 -170.09 0 0 0 0
xxx TABLE:ev19_jmky_allchecks_posmass xxxxxxxxxxxxxxxxxx
c1
_________
r1 0.0053864
r2 0.0053978
r3 0.005409
r4 0.0056805
r5 0.0056903
r116141 0.97814
r116142 0.97816
r116143 1.071
r116144 1.071
r116145 1.0711