READ ME

To run most of the codes, one needs Dynare, OccBin and other Matlab functions included in the folder "OccBin and other functions".

For the estimation of the parameters for the occasionally binding model, a minimal working example can be found in the folder "Estimation code" by running run_estimation.m.   
The code is designed for transparency rather than speed and takes 24 hours to run for 1000 draws on a personal laptop (Intel Core i5 CPU at 2.4GHz and 16GB RAM). To achieve convergence, this number should be increased to at least 10 000, and ideally 100 000 with two separate chains. 

Figure 3 and 4 can be replicated by running run_filter_plot.m in the "Figure 3 and 4 - filtering" folder. Parameters are set to the estimated values stored in file params_estim.mod generated by running the estimation code.

Figure 5 can be generated by running run_irf_plots.m in the "Figure 5 and 6 - IRFs" folder. This file uses estimation results stored in files filtered_variables.mat and filtered_errs.mat, and consists of two sections. The first section generates the IRFs and must be run four times for the four dates used in the figure. The second section uses the thus generated files to plot the figure.

Figure 6 can be generated by first running twice irfsm.m in the "Figure 5 and 6 - IRFs" folder for different multiples of the standard deviation of shocks, and then by running irfsm_plot.m.










