Skip to content

leippold/ADI-replication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Replication Package

Policy Shocks and Algorithmic Infrastructure Dependence

Leippold, Colesanti Senni, and Vaghefi

Overview

This folder contains all code necessary to replicate the results in the paper. Raw and intermediate data files are not included because they contain proprietary WRDS/CRSP data and SEC-API extracts subject to licensing restrictions. The instructions below describe how to obtain the data and reproduce every table and figure.

Prerequisites

Software

  • Python >= 3.10
  • LaTeX distribution (TeX Live or MiKTeX) for compiling the manuscript
  • Google Colab accounts (optional; notebooks run locally with minor path edits)

Data access (not included)

Source What How to obtain
WRDS/CRSP Daily equity returns, market cap, share codes Academic subscription at https://wrds-www.wharton.upenn.edu/
Kenneth French Data Library Fama-French 5 factors, industry classifications, NYSE breakpoints Free download at https://mba.tuck.dartmouth.edu/pages/faculty/ken.french/data_library.html
SEC EDGAR (via SEC-API) 10-K filing text (Items 1, 1A, 7) API key from https://sec-api.io/
OptionMetrics (via WRDS) Implied volatility surface Included in WRDS subscription
Compustat (via WRDS) Accounting fundamentals Included in WRDS subscription

Copy .env.example to .env and fill in your WRDS and SEC-API credentials.

Python setup

pip install -e ".[full]"
# or
pip install -r requirements.txt

Reproduction steps

Step 1: Construct ADI scores

Notebook Purpose Inputs Outputs
ADI_Score_Generator.ipynb Build ADI from 10-K filings SEC-API credentials data/adi_scores.csv
ADI_Sentence_Extractor.ipynb Extract AI-relevant sentences 10-K text Sentence-level data

Step 2: Run main event study

Notebook Purpose Outputs
ADI_Event_Study_Colab.ipynb Main event study (Tables 1-4, Figures 1-3) tables/table1_summary_stats.tex through table4_alphas.tex, figures

Step 3: Robustness and extensions

Notebook Purpose Key outputs
ADI_Options_Event_Study.ipynb IV channel, CAR/IV joint table table_car_iv_combined.tex
ADI_Compustat_Validation.ipynb Accounting validation table_adi_vs_fundamentals.tex, table_decile_monotonicity.tex
ADI_Mechanical_Events.ipynb Stacked regression, meta-regression, placebo table_stacked_regression.tex, table_meta_regression.tex, table_placebo.tex
ADI_Component_Shock_Matching.ipynb Component-event interaction matrix table_component_event_matrix.tex
ADI_Diversification_Response.ipynb Real-effects (diversification language) table_diversification_response.tex
ADI_News_Index_Colab.ipynb News-based event validation table7_news_index.tex

Step 4: Transformer comparison (Internet Appendix)

Notebook Purpose
ADI_Transformer_v2_Extract.ipynb Extract training data for ModernBERT
ADI_Transformer_v2_Classify.ipynb Fine-tune ModernBERT classifier
ADI_Transformer_v2_ModernBERT.ipynb Score filings with transformer
ADI_Transformer_Event_Study.ipynb Quadrant analysis, horse-race regressions

Step 5: Compile manuscript

pdflatex 00_master_paper.tex
bibtex 00_master_paper
pdflatex 00_master_paper.tex
pdflatex 00_master_paper.tex

Step 6: Consistency check

Notebook Purpose
ADI_Consistency_Check.ipynb Verify all tables match manuscript numbers

File inventory

replication/
  README.md              <- This file
  .env.example           <- Template for credentials (no secrets)
  requirements.txt       <- Python dependencies
  pyproject.toml         <- Package configuration
  src/adi/               <- Python package (scoring, event study, extraction)
  notebooks/             <- Jupyter notebooks (analysis pipeline)
  tests/                 <- Unit tests
  tables/                <- Generated LaTeX tables
  figures/               <- Generated figures
  sections/              <- LaTeX manuscript sections
  00_master_paper.tex    <- Master LaTeX file
  biblio.bib             <- Bibliography
  LICENSE                <- MIT license

What is NOT included

  • Raw data files (data/): CRSP returns, Compustat fundamentals, OptionMetrics IV, SEC filing text. These are proprietary and must be obtained with valid WRDS/SEC-API credentials.
  • Credentials (.env): API keys and passwords.
  • Presentation materials: Slides, keynote scripts, transcripts.
  • Working notes: REVISION_top_tier.md, CLAUDE.md, results_unified_sample.md.

About

Replication files for "Policy Shocks and Algorithmic Infrastructure Dependence"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors