JAX replication of the corrected model in Perla, Tonetti, and Waugh (AER):
SMM calibration, balanced-growth-path counterfactuals, transition dynamics,
and every table and figure the corrigendum includes. The repository is
self-contained: the published-model overlays and SMM data targets are frozen
CSV artifacts in data/.
See Corrigendum: Equilibrium Technology Diffusion, Trade, and Growth for a description of the new quantitative results and the numerical algorithm.
Install uv:
curl -LsSf https://astral.sh/uv/install.sh | shon MacOS or Linuxpowershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"on Windows
uv run installs the pinned dependencies on first use; uv sync installs
them explicitly from uv.lock.
Replicate all results and generated figures, tables with
bash replicate.shResults are saved output/. Timings on an
Apple-silicon laptop are about 1 minute. Individual drivers, from the
repository root:
uv run python replication_estimation.py # SMM at the published AER theta and sigma: fit and welfare
uv run python estimation_robust.py # independent closed-form-versus-grid verification of that fit
uv run python replication_results.py # transition dynamics for the 10% trade-cost cut: welfare and result artifact
uv run python replication_tables.py # the corrigendum's tables as \input-ready fragments, the eq-(60) welfare decomposition, and the published-path welfare re-aggregation
uv run python replication_figures.py # manuscript figures and an auxiliary counterfactual sweep
uv run python bgp_grid_convergence.py # discrete-BGP-to-analytic convergence table across grid refinements
uv run python numerics_macros.py # numerics-appendix macros sourced from the artifacts aboveThe estimation writes estimation_theta4.98898_sigma3.16692.json; the
downstream drivers load their parameters from it.
A full run leaves in output/:
estimation_theta4.98898_sigma3.16692.json— the accepted SMM fitverification_theta4.98898_sigma3.16692.json— the independent verification summarytransition_results.jsonandtransition_arrays.npz— the auditable transition result artifactbgp_grid_convergence.json— the grid-convergence table inputsinline_results.json— the rounded numbers used in the corrigendum's prosetable_params.tex,table_moments.tex,table_persistence.tex,table_results.tex,decomposition_equation.tex—\input-ready table fragmentsinline_macros.tex,figure_macros.tex,numerics_macros.tex—\input-ready macro files- the eight manuscript figures
corr_density.pdf,ovl_trade.pdf,ovl_omega.pdf,ovl_fixed_costs.pdf,ovl_log_consumption_inset.pdf,ovl_growth.pdf,corr_gbm_chi.pdf,corr_delta_chi.pdf, plus the auxiliaryovl_counterfactual.pdf
Every driver exposes its options on the CLI (--help for the full list):
# results-only transition solve on a coarser preview grid (the table and
# figure drivers intentionally reject it because they require the production
# AlgorithmSettings; the defaults are the production grids)
uv run python replication_results.py \
--alg_set.z_segment_1_points 720 --alg_set.z_segment_2_points 960 \
--alg_set.z_segment_3_points 480