This set of Matlab codes is for replication of MC experiments in "Pooled Bewley Estimator of Long Run Relationships in Dynamic Heterogenous Panels" by A. Chudik, M.H. Pesaran and R. Smith, May 2021.

There are two possible ways of executing Monte Carlo experiments: a) on a local desktop or b) on a cluster.

A. Executing MC experiments on a local desktop

It can take a very long time to compute the MC experiments on a single desktop, depending on the hardware. The main script to run is run_me_MC.m. This script computes the MC experiments and saves them in the Excel file 'results.xlsx'. Results for Table 1 of the paper are located in the sheet 'MC_results'.

B. Computing MC experiments on a cluster

Script 'submit_MDCS_MC_job_to_cluster.m' submits the job 'job_MC_for_cluster.m' to a cluster. Cluster configuration on lines 10-16 of 'submit_MDCS_MC_job_to_cluster.m' needs to be set up to match the chosen available cluster. Once the cluster job is executed and finished, results will be saved on a cluster in a mat file 'MC_results.mat' (located in the specified folder on line 16). Copy this file to a local desktop in the matlab working folder where these codes are located. Then execute 'save_xls_from_matfile.m' to load the results from mat file and save then in Excel file 'results.xlsx'. Results for Table 1 of the paper are located in the sheet 'MC_results'.

