Skip to content

brycewang-stanford/Auto-Empirical-Research-Skills / skills/20-wenddymacro-python-econ-skill

python-econ-computing

Verified

Use when writing Python code for DSGE models, HANK models, numerical economic computation, causal inference, or quantitative economic data analysis

FileKindSize
README-original.mdmarkdown1.3 KB
SKILL.mdskill md30.9 KB

README-original.md

View on GitHub
# python-econ-skill
Awesome AI for DSGE and Causal Inference etc.

# Python Economic Numerical Computing
- Author:Wenli Xu
- Email: wlxu@cityu.edu.mo
- 2026-03-11
---


## Overview

Best practices for macroeconomic modeling (DSGE/HANK), causal inference, and data analysis in Python. Core principle: **vectorize first, accelerate loops with Numba, keep code structure aligned with economic theory**.

---

## Library Quick Reference

| Use Case | Preferred Libraries |
|----------|-------------------|
| Numerical core | `numpy`, `scipy` |
| Loop acceleration | `numba` (`@njit`, `@njit(parallel=True)`) |
| Economics toolkit | `quantecon` |
| HANK / sequence space | `sequence_jacobian` (SSJ) |
| Heterogeneous agents | `HARK` |
| **Linear models with FE** | **`pyfixest`** (`pip install pyfixest`) |
| **DID / DD / DDD** | **`diff-diff`** (`pip install diff-diff`) |
| **IV / 2SLS / GMM** | **`linearmodels`** (or `pyfixest` for panel IV with FE) |
| **RD / RDD / RKD** | **`rdrobust`**, `rddensity`, `rdlocrand` |
| **Synthetic Control** | **`pysynth`**, `synth_control`, `sdid` |
| **Matching** | **`causalml`**, `pymatch`, `econml` |
| **Causal ML / DML** | **`econml`**, `dowhy` |
| Data manipulation | `pandas`, `polars` (large datasets) |
| Visualization | `matplotlib`, `seaborn` |
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall