Code for "Can Consumers Distinguish Persistent from Transitory Income Shocks?", Druedahl and Jørgensen, 2020.
- MATLAB
- C++ compiler
The code was run and tested with "MATLAB 2018b" and "Intel Parallel Studio XE 2018 for C++" on a 64-bit Windows machine.
vectorclass: The code relies on the vectorclass library developed by Agnar Fog.
Alternative C++ compiler: You can alternatively install the "MinGW GCC" C++ compiler extension to MATLAB. Set intel = 0
in run_00_all.m
. If you use another MATLAB version change the path to libgomp.a
in compile_mex.m
accordingly.
Everything can be run from run_00_all.m
. It calls all the run_*.m
files in the correct order.
- Input: PSID data in
psid/*.txt
. - Output: All figures and tables are saved in
fig_tabs/
.
Computation time: We have included a switch, DO_SMALL
, in the main MATLAB file run_00_all.m
. If its value is 0
the full Monte Carlo results with 200 runs will be produced. If its value is 1
(the default) only 5 Monte Carlo runs will be executed. Running the code with DO_SMALL = 0
takes about 10 days and 12 hours using 56 threads on a computer with 2x Intel(R) Xeon(R) Gold 6154 3.00 GHz CPUs (18 cores, 36 logical processes each). Running the code with DO_SMALL = 1
takes around 19 hours using the same computer specified above, but does not reproduce the Monte Carlo results in the paper.
Mapping between folders and results in the paper: All results are placed in the "figs_tab" folder which includes a set of sub-folder. Here is the list of figures and tables from the main text and the supplemental material:
- Figure 1 and 2 is in the folder "full_MC"
- Figure 3 is in the folder "full"
- Figure 4 is in the folder "sigma_eps_full"
- Figure 5 is in the folders "full_pref" (panels a and b) and "beta_full" (panels c and d)
- Table 2 is "ceq.tex"
- Table 3 is "main.tex"
- Table 4 is "robustness_full.txt"
- Figure C1 and C2 is in the folder "pers_zero_MC"
- Figure C3 and C4 is in the folder "pers_MC"
- Figure C5 is in the folder "pers_beta_MC" (panel a), "pers_psi_MC" (panel b), "pers_xi_MC" (panel c) and "pers_alpha_MC" (panel d)
- Table C1 is "ceq_tau_low.tex"
- Table C2 is "ceq_tau_high.tex"
- Figure C6 is in the folder "ceq"
- Figure C7 is in the folder "PT"
- Figure C8 is in the folder "pers"
- Figure C9 is in the folder "sigma_eps_PT"
- Figure C10 is in the folder "sigma_eps_pers"
- Table C3 is "robustness_PT.txt"
- Table C4 is "robustness_pers.txt"
- Figure C11 is in the folder "omega_Commault"
- Figure C12 is in the folder "sigma_eps_PT" (panels a and b), "sigma_eps_pers" (panels c and d) and "sigma_eps_full" (panels e and f)
The used PSID data is found in psid/*.txt
.
To reproduce these txt-files run psid/construct_data.do
varying the value of scalar group
from 0 to 1 and 2. The code uses psid/data3.dta
taken from the replication package for Blundell et. al. (2008). The psid/construct_data.do
file is based on mindist_AER.do
from this replication package.