Content:
This folder contains the programs used to solve the model under the assumption that the TFP growth rate has a 
stochastic trend and the GAPL target has a deterministic time trend with coefficient equal to pi*.

----------------------------------
1. init_guesses (time: about 2 hours)
----------------------------------
!!!!!!!!! You can skip this step since the initial guess already exist.

This file computes guesses used to initialize the solution algorithm in 'master_file_solution_parallelfeb24_plt'.

- Outputs (stored in the folder 'Outputs')

  1) LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt.mat       --> initial guess and calibration, for pi*=0%
  2) LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt025.mat    --> initial guess and calibration, for pi*=2.5 bps
  3) LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt05.mat     --> initial guess and calibration, for pi*=5 bps
  4) LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt075.mat    --> initial guess and calibration, for pi*=7.5 bps
  5) LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt1.mat      --> initial guess and calibration, for pi*=10 bps
  6) LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt125.mat    --> initial guess and calibration, for pi*=12.5 bps
  7) LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt15.mat     --> initial guess and calibration, for pi*=15 bps
  8) LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt175.mat    --> initial guess and calibration, for pi*=17.5 bps 
  9) LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt20.mat     --> initial guess and calibration, for pi*=...
  10) LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt225.mat   --> initial guess and calibration, for pi*=...
  11) LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt25.mat    --> initial guess and calibration, for pi*=...
  12) LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt5.mat     --> initial guess and calibration, for pi*=...   

- Other Outputs (stored in the folder 'Outputs'): 
  1) spreadsheet named 'plt_15x15x15_uniform' in xls file named 'moments'   --> simulation moments and accuracy indicators for each of these economies 

- Intputs: calibrations (stored in folder 'Inputs')

-------------------------------------------------------------------------------------
2. master_file_solution_parallelfeb24_plt (computing time: about 3 hours)
-------------------------------------------------------------------------------------

- Outputs:

  1) LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt.mat       --> solution and simulated data for pi*=0%
  2) LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt025.mat    --> solution and simulated data for pi*=2.5 bps
  3) LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt05.mat     --> solution and simulated data for pi*=5 bps
  4) LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt075.mat    --> solution and simulated data for pi*=7.5 bps
  5) LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt1.mat      --> solution and simulated data for pi*=10 bps
  6) LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt125.mat    --> solution and simulated data for pi*=12.5 bps
  7) LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt15.mat     --> solution and simulated data for pi*=15 bps
  8) LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt175.mat    --> solution and simulated data for pi*=17.5 bps 
  9) LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt2.mat      --> solution and simulated data for pi*=20 bps 
  10) LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt225.mat   --> solution and simulated data for pi*=22.5 bps 
  11) LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt25.mat    --> solution and simulated data for pi*=25 bps  
  12) LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt5.mat     --> solution and simulated data for pi*=50 bps  

- Other Outputs: 
  1) spreadsheet named '50x50x50_uniform_plt' in xls file named 'moments'   --> simulation moments and accuracy indicators for each of these economies 

- Intputs 
  
  1) LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt.mat       --> initial guess and calibration, for pi*=0%
  2) LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt025.mat    --> initial guess and calibration, for pi*=2.5 bps
  3) LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt05.mat     --> initial guess and calibration, for pi*=5 bps
  4) LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt075.mat    --> initial guess and calibration, for pi*=7.5 bps
  5) LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt1.mat      --> initial guess and calibration, for pi*=10 bps
  6) LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt125.mat    --> initial guess and calibration, for pi*=12.5 bps
  7) LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt15.mat     --> initial guess and calibration, for pi*=15 bps
  8) LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt175.mat    --> initial guess and calibration, for pi*=17.5 bps 
  9) LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt20.mat     --> initial guess and calibration, for pi*=...
  10) LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt225.mat   --> initial guess and calibration, for pi*=...
  11) LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt25.mat    --> initial guess and calibration, for pi*=...
  12) LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt5.mat     --> initial guess and calibration, for pi*=...   

- Functions called by the program:
  parsave.m                                   --> saves solution and simulated data in a .mat file                                                      
  Grid_uniform.m                              --> constructs an 'evenly spaced' grid                 
  Policy_function_iteration.m                 --> solution algorithm  
  compute_duration_ELB.m                      --> computes the average duration of a ZLB episode          
  equations_plt_LFPWB.m                       --> model equations / computes endogenous varibales as well as 
                                                  the values of the detrended (log) price level and of the output gap implied by
                                                  the system of equations (new guesses)          
  invtsncdf.m                                 --> Computes the inverse of the truncated standard normal cumulative distribution function       
  simulate_plt_LFPWB.m                        --> generates (simulated) data, compute simulation moments, compute accuracy indicators                     
  sim_welfare_loss.m                          --> computes the unconditional welfare loss (L-bar in the appendix)
  simulate_plt_LFPWB_wthoxi.m                 --> not needed/used                  
  
- Other functions (not in the folder 'Functions'):
  qnwnorm                                     --> generates the (Gauss-Hermite) quadrature nodes and weights for computing the expectations of functions 
                                                  of normal random variates; in CompEcon toolbox 
  qnwlege                                     --> generates the (Gauss-Legendre) quadrature nodes and weights for computing a numerical integral on
                                                  a bounded interval; in CompEcon toolbox 

- Robustness check: alternative grid  
  
  1) disable these three command lines:
     grid_type             = 'uniform';
     construct_grid        = @Grid_uniform;
     excsheet              = '50x50x50_uniform_plt';

  2) enable these three command lines:
     grid_type             = 'adaptative_density';
     construct_grid        = @Grid_adaptative_density3;   --> the function 'Grid_adaptative_density3.m' constructs an 'adaptative' grid
     excsheet              = '50x50x50_adaptative_plt';

  3) Recommended 
     disable these command lines:

     fnames       = cell(N_calib,1);
     fnames(1)    = cellstr('LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt');
     fnames(2)    = cellstr('LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt025');
     fnames(3)    = cellstr('LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt05');
     fnames(4)    = cellstr('LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt075');
     fnames(5)    = cellstr('LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt1');
     fnames(6)    = cellstr('LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt125');
     fnames(7)    = cellstr('LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt15');
     fnames(8)    = cellstr('LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt175');
     fnames(9)    = cellstr('LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt2');
     fnames(10)   = cellstr('LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt225');
     fnames(11)   = cellstr('LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt25');
     fnames(12)   = cellstr('LFPWB_plt_grid_uniform_15x15x15_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt5');

     enable these command lines:

     fnames       = cell(N_calib,1);
     fnames(1)    = cellstr('LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt');
     fnames(2)    = cellstr('LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt025');
     fnames(3)    = cellstr('LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt05');
     fnames(4)    = cellstr('LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt075');
     fnames(5)    = cellstr('LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt1');
     fnames(6)    = cellstr('LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt125');
     fnames(7)    = cellstr('LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt15');
     fnames(8)    = cellstr('LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt175');
     fnames(9)    = cellstr('LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt2');
     fnames(10)   = cellstr('LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt225');
     fnames(11)   = cellstr('LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt25');
     fnames(12)   = cellstr('LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt5');


  4) Recommended (to avoid cluttering your hard drive): change dummy_save = 0 instead of 1

  Output: 
  1) spreadsheet named '50x50x50_adaptative_plt' in xls file named 'moments'   --> simulation moments and accuracy indicators 

  Other outputs (if you kept dummy_save = 1)
  1) LFPWB_plt_grid_adaptative_density_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt.mat       --> solution and simulated data for pi*=0%
  2) LFPWB_plt_grid_adaptative_density_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt025.mat    --> solution and simulated data for pi*=2.5 bps
  3) LFPWB_plt_grid_adaptative_density_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt05.mat     --> solution and simulated data for pi*=5 bps
  4) LFPWB_plt_grid_adaptative_density_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt075.mat    --> solution and simulated data for pi*=7.5 bps
  5) LFPWB_plt_grid_adaptative_density_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt1.mat      --> solution and simulated data for pi*=10 bps
  6) LFPWB_plt_grid_adaptative_density_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt125.mat    --> solution and simulated data for pi*=12.5 bps
  7) LFPWB_plt_grid_adaptative_density_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt15.mat     --> solution and simulated data for pi*=15 bps
  8) LFPWB_plt_grid_adaptative_density_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt175.mat    --> solution and simulated data for pi*=17.5 bps 
  9) LFPWB_plt_grid_adaptative_density_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt2.mat      --> solution and simulated data for pi*=20 bps 
  10) LFPWB_plt_grid_adaptative_density_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt225.mat   --> solution and simulated data for pi*=22.5 bps 
  11) LFPWB_plt_grid_adaptative_density_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt25.mat    --> solution and simulated data for pi*=25 bps  
  12) LFPWB_plt_grid_adaptative_density_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt5.mat     --> solution and simulated data for pi*=50 bps  


-------------------------------------------------------------------------------------------------------------------------
3. Welfare_computation (computing time: about 26h30 with university computer - less powerful and 4 physical cores only)
-------------------------------------------------------------------------------------------------------------------------

This file computes the unconditional welfare loss (W-bar in the appendix) for each calibration of pi*, stores these indicators in .mat files, and plots the unconditional welfare
loss in function of pi* (figure in appendix C).

- Inputs:
  1) LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt.mat       --> solution and simulated data for pi*=0%
  2) LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt025.mat    --> solution and simulated data for pi*=2.5 bps
  3) LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt05.mat     --> solution and simulated data for pi*=5 bps
  4) LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt075.mat    --> solution and simulated data for pi*=7.5 bps
  5) LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt1.mat      --> solution and simulated data for pi*=10 bps
  6) LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt125.mat    --> solution and simulated data for pi*=12.5 bps
  7) LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt15.mat     --> solution and simulated data for pi*=15 bps
  8) LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt175.mat    --> solution and simulated data for pi*=17.5 bps 
  9) LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt2.mat      --> solution and simulated data for pi*=20 bps 
  10) LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt225.mat   --> solution and simulated data for pi*=22.5 bps 
  11) LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt25.mat    --> solution and simulated data for pi*=25 bps  
  12) LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt5.mat     --> solution and simulated data for pi*=50 bps  

- Functions called by the program:
  recursion_welfare_loss_plt_LFPWB      --> computes the welfare loss for all nodes in the discretized state space by using a time iteration approach
  sim_welfare_loss_rec                  --> computes the unconditional welfare loss (W-bar in the appendix)
  parsave_welf                          --> saves W-bar in the appropriate .mat file


--------------------------------------------------------------------------
4. impulse_responses
--------------------------------------------------------------------------
This file computes the impulse response functions used to produce the different figures and stores them.

- Inputs:
  1) LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt.mat  
        --> model solution and simulated data for the price level targeting rule of Eggertsson and Woodford 2003
  
  2) LFPWB_plt_grid_uniform_50x50x50_cy_0pt73_rn_1pt5_beta_0pt9982_xilb_0pt_xiub_3pt_pistar_0pt1.mat
        --> model solution and simulated data for the optimal simple price level targeting rule, i.e., pi*=10 bps

- Functions called by the program:
  irf_plt_LFPWB_det.m      --> computes deterministic impulse responses to transitory or/and permanent 
                              real rate shocks
  irf_plt_LFPWB_new.m      --> computes the "mean dynamics" in response to shocks, i.e., the average response
                              over a certain number of stochastic simulations                 

