Skip to content

Commit

Permalink
misc changes: package, path no dropbox, control parameters, bookdown #18
Browse files Browse the repository at this point in the history
  • Loading branch information
FanWangEcon committed Nov 30, 2021
1 parent 37beea7 commit 886e50c
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 36 deletions.
Binary file modified PrjOptiSNW.mltbx
Binary file not shown.
15 changes: 10 additions & 5 deletions PrjOptiSNW.prj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<deployment-project plugin="plugin.toolbox" plugin-version="1.0">
<configuration build-checksum="2551043391" file="C:\Users\fan\PrjOptiSNW\PrjOptiSNW.prj" location="C:\Users\fan\PrjOptiSNW" name="PrjOptiSNW" target="target.toolbox" target-name="Package Toolbox">
<configuration build-checksum="4273408108" file="C:\Users\fan\PrjOptiSNW\PrjOptiSNW.prj" location="C:\Users\fan\PrjOptiSNW" name="PrjOptiSNW" target="target.toolbox" target-name="Package Toolbox">
<param.appname>PrjOptiSNW</param.appname>
<param.authnamewatermark>V. Nygaard, B. Sorensen, Fan Wang</param.authnamewatermark>
<param.email>fanwangecon@gmail.com</param.email>
<param.company>Univerity of Houston</param.company>
<param.summary>Dynamic Life Cycle US Simulation and Welfare Checks COVID-19</param.summary>
<param.summary>Dynamic Life Cycle US Simulation and Stimulus Checks COVID-19</param.summary>
<param.description>Dynamic Life Cycle US Simulation and Welfare Checks COVID-19</param.description>
<param.screenshot>${PROJECT_ROOT}\img\toolboxlogo.png</param.screenshot>
<param.version>0.1.9</param.version>
<param.version>0.1.10</param.version>
<param.output>${PROJECT_ROOT}\PrjOptiSNW.mltbx</param.output>
<param.products.name />
<param.products.id />
Expand Down Expand Up @@ -199,7 +199,6 @@ htmlpdfm/*
<file>${PROJECT_ROOT}\_log</file>
<file>${PROJECT_ROOT}\_output_kniti_html.yaml</file>
<file>${PROJECT_ROOT}\_output_kniti_pdf.yaml</file>
<file>${PROJECT_ROOT}\_simu</file>
<file>${PROJECT_ROOT}\AllocateR</file>
<file>${PROJECT_ROOT}\book.bib</file>
<file>${PROJECT_ROOT}\bookdown</file>
Expand All @@ -218,15 +217,21 @@ htmlpdfm/*
</build-deliverables>
<workflow />
<matlab>
<root>C:\Program Files\MATLAB\R2019b</root>
<root>C:\Program Files\MATLAB\R2020b</root>
<toolboxes>
<toolbox name="matlabcoder" />
<toolbox name="gpucoder" />
</toolboxes>
<toolbox>
<matlabcoder>
<enabled>true</enabled>
</matlabcoder>
</toolbox>
<toolbox>
<gpucoder>
<enabled>true</enabled>
</gpucoder>
</toolbox>
</matlab>
<platform>
<unix>false</unix>
Expand Down
4 changes: 2 additions & 2 deletions PrjOptiSNW/doc/fgov/preamble.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
core :
- package: PrjOptiSNW
code: |
[snwx_stimulus_checks()](https://github.com/FanWangEcon/PrjOptiSNW/blob/master/PrjOptiSNW/fgov/snw_stimulus_checks.m),
[snw_stimulus_checks()](https://github.com/FanWangEcon/PrjOptiSNW/blob/master/PrjOptiSNW/fgov/snw_stimulus_checks.m),
date: 2021-05-14
date_start: 2021-05-14
output:
Expand All @@ -53,7 +53,7 @@
core :
- package: PrjOptiSNW
code: |
[snwx_stimulus_checks_biden()](https://github.com/FanWangEcon/PrjOptiSNW/blob/master/PrjOptiSNW/fgov/snw_stimulus_checks_biden.m),
[snw_stimulus_checks_biden()](https://github.com/FanWangEcon/PrjOptiSNW/blob/master/PrjOptiSNW/fgov/snw_stimulus_checks_biden.m),
date: 2021-05-14
date_start: 2021-05-14
output:
Expand Down
32 changes: 28 additions & 4 deletions PrjOptiSNW/doc/splannerjmky/preamble.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@
urlcolor: blue

- file: snwx_evuvw19_jmky_allchecks
title: "Expected Value from 2019 Given Age, Kids, Income and Marriage for All Checks"
titleshort: "Expected Value from 2019 Given Age, Kids, Income and Marriage for All Checks"
title: "Expected Value from 2019/2020 Given Age, Kids, Income and Marriage for All Checks"
titleshort: "Expected Value from 2019/2020 Given Age, Kids, Income and Marriage for All Checks"
description: |
Expected Value from 2019 Given Age, Kids, Income and Marriage for All Checks.
Expected Value from 2019/2020 (Trump/Biden Checks) Given Age, Kids, Income and Marriage for All Checks.
This is the gateway function that solves policy functions, derive distributions, computes value in 2020 with and without unemployment shocks with varying check levels, derives 2019 planner expected values given household optimization and shocks, and finds the mass of individuals in different income/age/marital-status bins, and saves the simulated value of check results for the planner.
core :
- package: PrjOptiSNW
code: |
[snw_evuvw19_jmky_allchecks()](https://github.com/FanWangEcon/PrjOptiSNW/blob/master/PrjOptiSNW/splanneralt/snw_evuvw19_jmky_allchecks.m)
date: 2020-08-07
date: 2021-11-29
date_start: 2020-08-07
output:
pdf_document:
Expand All @@ -45,3 +45,27 @@
in_header: '../../../hdga.html'
always_allow_html: true
urlcolor: blue

- file: snwx_evuvw07_jmky_allchecks
title: "Expected Value from 2007 Given Age, Kids, Income and Marriage for All Checks"
titleshort: "Expected Value from 2007 Given Age, Kids, Income and Marriage for All Checks"
description: |
Expected Value from 2007 Given Age, Kids, Income and Marriage for All Checks.
This is the gateway function that solves policy functions. The function derives distributions, computes value in 2008 with varying check levels, given unemployment expectation in 2009. It finds the 2007 planner expected values given household optimization and shocks, and finds the mass of individuals in different income/age/marital-status bins, and saves the simulated value of check results for the planner.
core :
- package: PrjOptiSNW
code: |
[snw_evuvw19_jmky_allchecks()](https://github.com/FanWangEcon/PrjOptiSNW/blob/master/PrjOptiSNW/splanneralt/snw_evuvw19_jmky_allchecks.m)
date: 2021-11-29
date_start: 2021-11-29
output:
pdf_document:
pandoc_args: '../../../_output_kniti_pdf.yaml'
includes:
in_header: '../../../preamble.tex'
html_document:
pandoc_args: '../../../_output_kniti_html.yaml'
includes:
in_header: '../../../hdga.html'
always_allow_html: true
urlcolor: blue
4 changes: 2 additions & 2 deletions PrjOptiSNW/doc/svalpolsmall/preamble.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
core :
- package: PrjOptiSNW
code: |
[snwx_vfi_bisec_vec()](https://github.com/FanWangEcon/PrjOptiSNW/blob/master/PrjOptiSNW/svalpol/snw_vfi_main_bisec_vec.m)
[snw_vfi_bisec_vec()](https://github.com/FanWangEcon/PrjOptiSNW/blob/master/PrjOptiSNW/svalpol/snw_vfi_main_bisec_vec.m)
date: 2020-08-07
date_start: 2020-08-07
output:
Expand All @@ -81,7 +81,7 @@
core :
- package: PrjOptiSNW
code: |
[snwx_vfi_bisec_vec()](https://github.com/FanWangEcon/PrjOptiSNW/blob/master/PrjOptiSNW/svalpol/snw_vfi_main_bisec_vec.m)
[snw_vfi_bisec_vec()](https://github.com/FanWangEcon/PrjOptiSNW/blob/master/PrjOptiSNW/svalpol/snw_vfi_main_bisec_vec.m)
date: 2020-08-07
date_start: 2020-08-07
output:
Expand Down
63 changes: 42 additions & 21 deletions PrjOptiSNW/params/snw_mp_control.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,36 @@
% same container map
%
% MP_CONTROLS = SNW_MP_CONTROL(ST_PARAM_GROUP)
% generates default parameters for the type ST_PARAM_GROUP.
% generates default parameters for the type ST_PARAM_GROUP.
%
% MP_CONTROLS = SNW_MP_CONTROL(ST_PARAM_GROUP, bl_print_mp_controls) generates
% default parameters for the type ST_PARAM_GROUP, display parameter map
% details if bl_print_mp_controls is true.
%
%
% See also SNWX_MP_CONTROLS
%

%%
function varargout = snw_mp_control(varargin)
%% Parse Main Inputs and Set Defaults
if (~isempty(varargin))

if (length(varargin)==1)
st_param_group = varargin{:};
bl_print_mp_controls = false;
elseif (length(varargin)==2)
[st_param_group, bl_print_mp_controls] = varargin{:};
end

else
st_param_group = 'default_base';
st_param_group = 'default_test';

st_param_group = 'default_base';
st_param_group = 'default_test';
bl_print_mp_controls = true;

end

%% Control Optimization
%% Control Optimization
%amin=0;
%amax=agrid(end);
A_aux=[];
Expand All @@ -46,11 +46,11 @@
options=optimoptions('fmincon','Display', 'off');
options2=optimoptions('fsolve','Display','off');

%% Control Calibration
%% Control Calibration
err=1;
tol=0.005;

%% Control What to Calculate
%% Control What to Calculate
bl_compute_drv_stats = true;

%% Control Profiling and Display
Expand All @@ -70,21 +70,28 @@
bl_print_evuvw19_jmky_mass = true;
bl_print_evuvw19_jmky_allchecks = true;
bl_print_find_tax_rate = true;

if (strcmp(st_param_group, 'default_test'))
bl_print_v08p08_jaeemk = true;
bl_print_calibrate_2009 = true;
bl_print_v08_jaeemk = true;

if (strcmp(st_param_group, 'default_test'))
bl_print_ds_verbose = true;
bl_print_ds_aggregation_verbose = true;
bl_print_vfi_verbose = true;
bl_print_a4chk_verbose = true;
bl_print_vu_vw_verbose = true;
bl_print_v_planner_verbose = true;
bl_print_v_planner_verbose = true;
bl_print_precompute_verbose = true;
bl_print_evuvw20_jaeemk_verbose = true;
bl_print_evuvw19_jaeemk_verbose = true;
bl_print_evuvw19_jmky_verbose = true;
bl_print_evuvw19_jmky_mass_verbose = true;
bl_print_evuvw19_jmky_allchecks_verbose = true;
bl_print_find_tax_rate_verbose = true;
bl_print_v08p08_jaeemk_verbose = true;
bl_print_calibrate_2009_verbose = true;
bl_print_v08_jaeemk_verbose = true;

else
bl_print_ds_verbose = false;
bl_print_ds_aggregation_verbose = false;
Expand All @@ -99,9 +106,13 @@
bl_print_evuvw19_jmky_mass_verbose = false;
bl_print_evuvw19_jmky_allchecks_verbose = false;
bl_print_find_tax_rate_verbose = false;
bl_print_v08p08_jaeemk_verbose = false;
bl_print_calibrate_2009_verbose = false;
bl_print_v08_jaeemk_verbose = false;

end

%% Control Optimization
%% Control Optimization
mp_minimizer_controls = containers.Map('KeyType', 'char', 'ValueType', 'any');

mp_minimizer_controls('A_aux') = A_aux;
Expand Down Expand Up @@ -144,7 +155,7 @@

mp_display('bl_print_v_planner') = bl_print_v_planner;
mp_display('bl_print_v_planner_verbose') = bl_print_v_planner_verbose;

mp_display('bl_print_precompute') = bl_print_precompute;
mp_display('bl_print_precompute_verbose') = bl_print_precompute_verbose;

Expand All @@ -166,12 +177,22 @@
mp_display('bl_print_find_tax_rate') = bl_print_find_tax_rate;
mp_display('bl_print_find_tax_rate_verbose') = bl_print_find_tax_rate_verbose;

mp_display('bl_print_v08p08_jaeemk') = bl_print_v08p08_jaeemk;
mp_display('bl_print_v08p08_jaeemk_verbose') = bl_print_v08p08_jaeemk_verbose;

mp_display('bl_print_calibrate_2009') = bl_print_calibrate_2009;
mp_display('bl_print_calibrate_2009_verbose') = bl_print_calibrate_2009_verbose;

mp_display('bl_print_v08_jaeemk') = bl_print_v08_jaeemk;
mp_display('bl_print_v08_jaeemk_verbose') = bl_print_v08_jaeemk_verbose;


%% Combine Maps
mp_controls = [mp_minimizer_controls; mp_m4check_controls; ...
mp_calibrate; mp_compute_stats; mp_profile; mp_display];
mp_controls('mp_params_name') = string(st_param_group);

%% Print
%% Print
if (bl_print_mp_controls)
ff_container_map_display(mp_controls);
end
Expand All @@ -188,13 +209,13 @@
elseif (it_k==4)
ob_out_cur = mp_calibrate;
elseif (it_k==5)
ob_out_cur = mp_compute_stats;
ob_out_cur = mp_compute_stats;
elseif (it_k==6)
ob_out_cur = mp_profile;
ob_out_cur = mp_profile;
elseif (it_k==7)
ob_out_cur = mp_display;
ob_out_cur = mp_display;
elseif (it_k==8)
ob_out_cur = mp_store;
ob_out_cur = mp_store;
end
varargout{it_k} = ob_out_cur;
end
Expand Down
11 changes: 10 additions & 1 deletion PrjOptiSNW/params/snw_mp_path.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,18 @@
if (exist('D:/Dropbox (UH-ECON)', 'dir')>0)
spt_dropbox_root = fullfile('D:/Dropbox (UH-ECON)/PrjNygaardSorensenWang/');
spt_rootlocal_root = fullfile('G:/repos/');
elseif (exist('C:/Users/fan/Documents/Dropbox (UH-ECON)/', 'dir')>0)
elseif (exist('C:/Users/fan/Documents/Dropbox (UH-ECON)/PrjNygaardSorensenWang/', 'dir')>0)
spt_dropbox_root = fullfile('C:/Users/fan/Documents/Dropbox (UH-ECON)/PrjNygaardSorensenWang/');
spt_rootlocal_root = fullfile('C:/Users/fan/');
else
% Windows local computer does not have dropbox folder with the project, store under user documents
if (exist('C:/Users/fan/PrjNygaardSorensenWang/', 'dir')>0)
% do nothing.
else
mkdir('C:/Users/fan/PrjNygaardSorensenWang/');
end
spt_dropbox_root = fullfile('C:/Users/fan/PrjNygaardSorensenWang/');
spt_rootlocal_root = fullfile('C:/Users/fan/');
end
end

Expand Down
7 changes: 6 additions & 1 deletion _bookdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ rmd_files:

- PrjOptiSNW/doc/svalpolunemploy/main.Rmd
- PrjOptiSNW/doc/svalpolunemploy/snwx_vfi_unemp_bisec_vec.Rmd
- PrjOptiSNW/doc/svalpolunemploy/snwx_v08p08_jaeemk.Rmd
- PrjOptiSNW/doc/svalpolstimulus/main.Rmd
- PrjOptiSNW/doc/svalpolstimulus/snwx_vfi_bisec_vec_stimulus.Rmd

Expand All @@ -42,11 +43,14 @@ rmd_files:

- PrjOptiSNW/doc/splannerjaeemk/main.Rmd
- PrjOptiSNW/doc/splannerjaeemk/snwx_evuvw20_jaeemk.Rmd
- PrjOptiSNW/doc/splannerjaeemk/snwx_evuvw19_jaeemk.Rmd
- PrjOptiSNW/doc/splannerjaeemk/snwx_evuvw19_jaeemk_foc.Rmd
- PrjOptiSNW/doc/splannerjaeemk/snwx_v08_jaeemk.Rmd
- PrjOptiSNW/doc/splannerjaeemk/snwx_evuvw07_jaeemk_foc.Rmd

- PrjOptiSNW/doc/splannerjmky/main.Rmd
- PrjOptiSNW/doc/splannerjmky/snwx_evuvw19_jmky.Rmd
- PrjOptiSNW/doc/splannerjmky/snwx_evuvw19_jmky_allchecks.Rmd
- PrjOptiSNW/doc/splannerjmky/snwx_evuvw07_jmky_allchecks.Rmd

- PrjOptiSNW/doc/fgov/main.Rmd
- PrjOptiSNW/doc/fgov/snwx_find_tax_rate.Rmd
Expand All @@ -56,6 +60,7 @@ rmd_files:
- PrjOptiSNW/doc/calibrate/main.Rmd
- PrjOptiSNW/doc/calibrate/snwx_calibrate_beta_norm_gdp.Rmd
- PrjOptiSNW/doc/calibrate/snwx_calibrate_lockdown_c.Rmd
- PrjOptiSNW/doc/calibrate/snwx_calibrate_2009_b.Rmd

- PrjOptiSNW/doc/stats/main.Rmd
- PrjOptiSNW/doc/stats/snwx_evuvw19_jaeemk_mky.Rmd
Expand Down

0 comments on commit 886e50c

Please sign in to comment.