Run the do files first to construct the data input for the fortran estimation routine.  First run construct_consumption_input.do which uses raw data in the psidraw folder (place them in same directory).

Next run setupdataforfortran.do, which uses inputconsumption, which is created by construct_consumption_input.do

After constructing these input files, put them in the same directory where you are running the fortran code.

Next run findpointestimate.f90

Among other outputs, this constructs "durablegaps_resultswithparam.txt".  We have included a zipped version of this output for those that do not want to run the model estimation.

Running bestfit.m in matlab uses this fortran output to select the best fit parameter point estimates, and plot Figures 12 and 13 using this best fit.

These point estimates are hard-coded into extrastats.f90, which computes the data for Figure 5.  Input this data into makefigure5.m to plot figure 5.

To run the bootstrap confidence intervals, run bootstrapconfidenceintervals.f90.  This fortran code creates gapsandcoefficients_bsresults.txt,
which togeter with coefficientsgaps_paramrep.txt created in findpointestimate.f90, are input into makeFig3and4.  The raw gapsandcoefficients_bsresults.txt file is several gigabytes,
and it is several hundred megabytes when compressed, so we are not including this intermediate step in the replication files to make them more manageable.  Please email
joseph.vavra@chicagobooth.edu if you want this intermediate output and are unable to produce it using bootstrapconfidenceintervals.f90.

