This is the replication package for my paper "Firm Dynamics and Random Search over the Business Cycle" published in the Journal of Monetary Economics [doi].
If you find this package helpful in your work, please consider citing the paper:
@article{audoly2026firm,
author = {Audoly, Richard},
title = {{Firm Dynamics and Random Search over the Business Cycle}},
journal = {Journal of Monetary Economics},
volume = {158},
pages = {103902},
year = {2026},
doi = {10.1016/j.jmoneco.2026.103902}
}
code/: replication scriptsdata/: replication input data and intermediate artifactsfigures/: final figures produced by replication scripts [created by running the code]tables/: final tables produced by replication scripts [created by running the code]
- Stata (last run on Stata/SE 18)
- MATLAB (last run on R2023a)
- The figure scripts call
recessionplot, which is provided by the MATLAB Econometrics Toolbox.
- The figure scripts call
- Step 1: Firm-level micro data
- Step 2: Time series data
- Step 3: Solve and simulate alternative models
- Step 4: Generate figures and tables
This step derives several key statistics from confidential British firm-level data.
The raw firm-level data is confidential and cannot be shared. Access can be requested from the UK Data Service.
The relevant datasets are:
- Business Structure Database (BSD): http://doi.org/10.5255/UKDA-SN-6697-10
- Annual Business Survey (ABS): http://doi.org/10.5255/UKDA-SN-7451-15
- Annual Respondents Database (ARD): http://doi.org/10.5255/UKDA-SN-6644-5
Scripts are located in code/step1_firm_micro_data/. The scripts do not need to be run to reproduce the paper.
The moments and time series derived from this step are already included in the replication package given the confidential nature of the underlying data. The scripts do not need to be run to reproduce the paper.
This step constructs the time-series inputs used by the model code.
data/time_series/raw/- Raw ONS/BHPS/ABS/BSD inputs used to construct macro series.
data/time_series/recessions_uk/dates.csvquarters.csv
Scripts are located in code/step2_time_series_data/:
clean_series.do- Reads raw inputs and constructs monthly/quarterly/yearly series in Stata format.
detrend_series.do- Applies detrending (HP and band-pass filters) and exports the detrended series used by the model.
- Removes intermediate Stata
.dtaartifacts after exporting the final.csvfiles.
prepare_model_series.m- Interpolates the yearly detrended series to a monthly frequency and exports
monthly_series.csv.
- Interpolates the yearly detrended series to a monthly frequency and exports
Run from the code/step2_time_series_data/ folder.
-
Stata:
- Run
clean_series.do - Run
detrend_series.do
- Run
-
MATLAB:
- Run
prepare_model_series.m
- Run
These files are created under data/time_series/detrended/:
quarterly_series.csvyearly_series.csvmonthly_series.csv
This step solves and simulates alternative model specifications and stores the solution and simulation output used to generate paper figures and tables. The code will take several hours to run.
data/model_parameters/- Calibration inputs for the steady state and aggregate shocks.
data/time_series/detrended/monthly_series.csv- Constructed in Step 2.
Scripts are located in code/step3_model_solutions_simulations/:
aggregate_shocks_simulations.m- Solves for multiple model configurations.
- Simulates business cycles and finds sequences of shocks matching target data series.
- Saves solutions to
data/model_solutions/and simulations todata/model_simulations/.
Run from the code/step3_model_solutions_simulations/ folder.
- MATLAB:
- Run
aggregate_shocks_simulations.m
- Run
This script writes under data/:
data/model_solutions/<model_type>/- Solution objects (e.g.,
theta_<steady_state>_<aggregate_shocks>).
- Solution objects (e.g.,
data/model_simulations/<model_type>/- Simulation output files named
<steady_state>_<aggregate_shocks>.mat(stored assimulation_output).
- Simulation output files named
This step generates the final figures and tables using the time series (Step 2) and model simulation output (Step 3).
data/time_series/detrended/monthly_series.csvyearly_series.csv
data/time_series/recessions_uk/dates.csvdata/model_simulations/- Simulation output files produced in Step 3.
data/model_parameters/- Used to re-solve steady-state models for some tables.
Scripts are located in code/step4_figures_and_tables/:
fig1.mfig2.mtab1.mtab2.mtab3.m
Run from the code/step4_figures_and_tables/ folder.
- MATLAB:
- Run
fig1.m - Run
fig2.m - Run
tab1.m - Run
tab2.m - Run
tab3.m
- Run
These files are created under figures/:
fig1a.*,fig1b.*,fig1c.*,fig1d.*,fig1e.*,fig1f.*fig2a.*,fig2b.*,fig2c.*,fig2d.*
The file extension is controlled by the MATLAB figure_options() helper.
These files are created under tables/:
tab1.txttab2.txttab3.txt