"Consumption risk sharing with private information and limited enforcement", by Broer, Kapicka, Klein ------------------ FILES FOR PSID DATA MOMENTS (table 1, table 4) ------------------ All files are located in folder PSID. The first main file is a STATA file PSID_main.do. The input is PSID_sampleC.dta, a sample C in Heathcote, Perri and Violante: "Unequal We Stand: An Empirical Analysis of Economic Inequality in the United States, 1967-2006", which is available on RED website, and thus not provided. It creates a dataset with year, household earnings, male and female age, male and female education level, and number of children in the household. Household earnings earnHH are defined as labor earnings plus 2/3 of self employment income plus private and public transfers plus food stamps minus taxes. (That is, household earnings are redpostgovinc minus redfinass plus foodstamps by using variables from PSID_sampleC.dta). The file PSID_main.do produces output files psiddata.dat and psiddata.xls. The second main file is a MATLAB file do.m. The input is psiddata.txt, obtained in the previous step. It obtains log earnings residual by regressing log of earnings lny=log(earnHH) on age polynomial of male and female, on education level of male and female, and on the number of children, and on dummies describing whether the household is a married couple, a single man or a single woman and whether the adult members of the household have more than 12 years of education, and time dummies. The residuals are plotted in Figure 2a. The file also calculates second moments (gammas) and third moments (thirdmoments) as in Table 4 in Appendix B. The results are saved in empmoments.mat. The third main file is a MATLAB file estimate.m. It uses the moments to estimate p, q, y_L and y_H by GMM and computes a two-state Markov chain approximation à la Rouwenhorst, allowing for skewness. The codes take about 30 seconds to run on 2016 iMac OSX. -------------------------------------- FILES FOR CEX DATA MOMENTS (table 2) -------------------------------------- All files are located in a folder called 'CEX', and should be largely self-explanatory. The main STATA .do file is 'CEX_RED_October_2016.do'. It loads the 'B' sample of Heathcote et al (RED 2010), which is available on RED's website and thus not provided, performs sample selection etc, and then writes CEX_c_alt_Sep_2016 (the sample used, a slightly amended version of Heathcote et al (RED 2010)'s 'C' sample), datasetCEXREDforbootstrap_Jan_2015.out (the data used to calculate bootstrapped standard errors and an interpolation à la Gervais and Klein (JME 2010)), datasetCEXREDforGK_Sep_2016.out GKinterpolateCEX_Sep_2016 then calculates the regression coefficients à la Gervais and Klein. After this, CEX_Bootstrap_Sep_2016.m calculates the interpolation, and the bootstrapped standard errors. The code contains further detail. ----------------------------------------- MATLAB FILES FOR SI, SILE, LE ECONOMIES ---------------------------------------- All files are in a folder called 'LE_SI_SILE'. The main programme file is 'KKB_SI_SILE_LE_Sep_2016'. It describes the options used to generate the different exercises in the paper. It calls - 'autarkyvalueSep2016nominus1' to calculate autarky values - 'AyagariZhangSep2016simpletax_new' to solve the SILE, SIN model - 'consdistribution2incomenewnominus1' to solve LE consumption distribution - 'wealthdistributionJune2013nominus1' to calculate the LE wealth distribution The programme saves the workspace as 'KKB_GE_tauc_1_allSep_16_ctax' (date may vary) for the benchmark case and cons tax exercise, and as 'KKB_GE_tauc_0_all_compSep_16_ctax' for the compression exercise, and as 'KKB_PE_tauc_0_allSep_16_ctax' for the partial equilibrium exercise. The main output matrix is called 'OUTPUT'. Its second dimension corresponds to three different models (SIN, SI ad hoc limit, SILE), and different tax rates (in column 18). Its third dimension is for different income processes. (benchmark=3, compression=4, others not used). I found it easier to generate a twodimensional matrix once everything is done by OUTPUT3=OUTPUT(:,:,3); or OUTPUT4=OUTPUT(:,:,4);. -------------------------------- MATLAB FILES FOR PILE ECONOMIES -------------------------------- All files are in a folder called 'PILE'. To compute benchmark equilibrium, run do.m in 'solution-constax - 0'. Once this is done, we have decision rules for a given beta. To simulate the economy (and solve for the GE by imposing the steady state version of the aggregate resource constraint, run simulate.m. Iterate by repeatedly running do.m and simulate.m and adjust beta until the resource constraint is satisfied. The simulate.m file creates the file cs.txt referred to below. When introducing consumption taxes, iterate not on beta (which is fixed) but on R. Run ge or geq to find the equilibrium interest rate and transfer that satisfies the government's budget constraint (in a steady state). To set the consumption tax to 5 (15, 20, 25, 30, 40, 50 60) percent run do.m and simulate.m in the relevant folders. To draw policy functions, run draw.m. This will evaluate the policy functions and create Matlab data files (.mat) containing the relevant values of the policy function on a grid. Figure 4 in the paper is constructed using these .mat files. ---------------------------------------- EXCEL FILE FOR TABLES AND FIGURES 5 AND 6 ---------------------------------------- The elements of the OUTPUT matrices described above, and the relevant output for the PILE model, are posted in separate worksheets entitled 'Bewley Tax', 'Bewley compression', and 'PE' (for partial equilibrium) in the excel file 'Results KKB Oct 2016' (date may vary, in the top folder). The worksheet 'Tables' and 'Graphs' contains the results for the paper, 'GE Sep 2016' all moments for all cases. ---------------------------------------- MATLAB FILES FOR FIGURES 3 AND 4 ---------------------------------------- All files are in a folder called 'Figures_3_4'. 'Figures_3_4_Sep_2016.m' draws figures 3 and 4 in the paper. It loads policy functions and simulated data for the PILE model ('paulvonhihi.mat', 'paulvonhilo.mat', 'paulvonlohi.mat', 'paulvonhihi.mat', 'costs.mat', and 'cs.txt', respectively, which should be copied from the subfolder named 'PILE'), and a workspace 'KKB_PE_tauc_0_allSep_16_ctax' for the other models (which should be copied from the subfolder named 'LE_SI_SILE').