Models & Statistical

Causal ML Auto-Inference

PyTorch implementation of the Farrell-Liang-Misra framework for automatic inference on individual heterogeneity in treatment effects.

Why it matters: Enables practitioners to estimate heterogeneous treatment effects with valid inference using deep learning, without manually deriving influence functions.

Problem

  • Estimating individual-level heterogeneity in treatment effects requires combining ML with causal inference
  • Computing valid standard errors for CATE estimates needs influence function calculations
  • Automatic differentiation can simplify gradient computation for influence functions

Approach

  • Implements the framework from 'Deep Learning for Individual Heterogeneity: An Automatic Inference Framework' (Farrell, Liang, Misra)
  • Uses PyTorch for building and training neural networks with MSE loss
  • Leverages automatic differentiation to compute gradients for the influence function estimator

Highlights / Evidence

  • Estimates Conditional Average Treatment Effects (CATE) using deep learning
  • Illustrates estimation and inference for the average treatment effect estimator
  • Based on arXiv:2010.14694

How to Run

git clone https://github.com/rmmomin/causal-ml-auto-inference.git
cd causal-ml-auto-inference
pip install -r requirements.txt

Requires Python 3.7+, PyTorch 1.7+. See README for full documentation.

Laubach-Williams r* Python Port

Faithful Python port of the NY Fed's Laubach-Williams (2003) natural rate of interest (r*) model.

Why it matters: Provides a validated, Python-native implementation of a foundational monetary policy model, enabling integration with modern data pipelines and research workflows.

Problem

  • The Laubach-Williams r* model is a key input for monetary policy analysis
  • Original NY Fed implementation limits accessibility for Python-based workflows
  • Need to replicate the three-stage estimation procedure faithfully

Approach

  • Implements the three-stage estimation: (1) potential output with trend growth, (2) interest rate sensitivity + λ_g, (3) full model with r* = c·g + z + λ_z
  • Uses Kalman filtering/smoothing for state-space estimation
  • Based on the 2023 NY Fed replication code

Highlights / Evidence

  • All estimates match published NY Fed figures within 0.04 percentage points
  • r* max absolute difference: 0.022 pp, RMSE: 0.012
  • Trend growth (g) max absolute difference: 0.008 pp, RMSE: 0.003
  • Includes COVID time-varying variance (kappa) support

How to Run

git clone https://github.com/rmmomin/laubach-williams-rstar-python.git
cd laubach-williams-rstar-python
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
python scripts/run_lw_port.py

Download Laubach_Williams_current_estimates.xlsx from NY Fed and place in data/. See README for data update instructions.

r* Brookings 2017 Replication (Python Port)

Python port of the TVAR estimation from 'Safety, Liquidity, and the Natural Rate of Interest' (del Negro et al., Brookings 2017).

Why it matters: Makes an influential r* model—accounting for safety and liquidity premia—accessible in Python for researchers and practitioners analyzing neutral rates.

Problem

  • The del Negro et al. (2017) paper provides influential estimates of r* accounting for safety and liquidity premia
  • Original MATLAB implementation limits reproducibility and integration with modern workflows
  • Need to maintain output compatibility with Brookings figures and tables

Approach

  • Translates the original MATLAB toolchain into a Python-first workflow
  • Mirrors MATLAB estimation and plotting scripts for side-by-side validation
  • Both ecosystems can run in parallel during transition

Highlights / Evidence

  • Replicates TVAR estimation from del Negro, Giannone, Giannoni, and Tambalotti (Brookings 2017)
  • Produces CSV data products (quantiles, chart feeds, combined draws)
  • Generates PNG charts corresponding to original Brookings figures
  • Supports environment variable overrides for draws, chains, and thinning

How to Run

git clone https://github.com/rmmomin/rstarBrookings2017.git
cd rstarBrookings2017
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
python -m python.main_model1

Python 3.9+ recommended. See README for environment variable toggles (RSTAR_NDRAWS, RSTAR_NCHAINS, etc.).

Data Pipelines

NY Fed Longer-Run Federal Funds Rate Extractor

Python tool that extracts 'Longer run target federal funds rate' percentiles from the NY Fed Survey of Market Expectations.

Why it matters: Provides a clean, validated time series of market expectations for the neutral fed funds rate—a key input for monetary policy analysis and r* research.

Problem

  • NY Fed publishes survey data across multiple formats (XLSX 2023+, PDFs 2012-2022)
  • Extracting consistent time series requires handling heterogeneous file formats
  • PDF tables need visual parsing to preserve layout and extract correct values

Approach

  • Scrapes the NY Fed Survey of Market Expectations page for all available files
  • Extracts from XLSX files when available (most reliable)
  • Uses GPT for visual PDF table extraction, preserving layout structure
  • Validates against Hartley (2024) r* survey dataset

Highlights / Evidence

  • Outputs tidy CSV with 25th, 50th, 75th percentiles by survey date and panel
  • 97% exact match with Hartley (2024) reference data
  • Covers SPD, SMP, and Combined panels from 2012-2025
  • Mean absolute difference vs. Hartley: 0.003 percentage points

How to Run

git clone https://github.com/rmmomin/nyfed-neutral-rate.git
cd nyfed-neutral-rate
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
export OPENAI_API_KEY="your-key-here"
python scripts/run_all.py

Requires Python 3.9+ and OpenAI API key for PDF extraction. See README for step-by-step pipeline details.

FOMC Press Minutes Parser

Automated pipeline that downloads Federal Reserve FOMC documents and analyzes discussion trends for immigration and productivity (2020-2025).

Why it matters: Provides systematic text analysis of Fed communications, enabling researchers to track how often specific economic topics appear in monetary policy discussions.

Problem

  • Fed press conference transcripts and meeting minutes are published as PDFs across multiple pages
  • Tracking discussion trends requires consistent extraction and counting methodology
  • Manual analysis is time-consuming and prone to inconsistency

Approach

  • Scrapes press conference transcripts and meeting minutes PDFs from federalreserve.gov
  • Uses pdfplumber for text extraction and word occurrence counting
  • Generates matplotlib visualizations showing mention frequency trends over time

Highlights / Evidence

  • Covers 49 press conference transcripts and 48 meeting minutes (2020-2025)
  • Tracks immigration and productivity discussion frequency
  • Outputs CSV data and multiple chart formats (combined, stacked bars, trend lines)
  • Modular pipeline with separate scripts for each stage

How to Run

git clone https://github.com/rmmomin/press-minutes-parser.git
cd press-minutes-parser
pip install -r requirements.txt
python run_pipeline.py

Requires Python 3.x, pdfplumber, matplotlib, requests.