brycewang-stanford/Auto-Empirical-Research-Skills / skills/20-wenddymacro-python-econ-skill
python-econ-computing
VerifiedUse when writing Python code for DSGE models, HANK models, numerical economic computation, causal inference, or quantitative economic data analysis
| File | Kind | Size |
|---|---|---|
| README-original.md | markdown | 1.3 KB |
| SKILL.md | skill md | 30.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` |
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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 implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| 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 fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| 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 always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |