本文へ移動
cccskills
無料GitHub で公開

causal-ml

This skill covers causal machine learning methods in applied economics and quantitative social science. Use when implementing or choosing between modern ML-based causal estimators — including double machine learning, DML, partially linear models, interactive regression models, cross-fitting, Neyman orthogonality, debiased ML, causal forests, generalized random forest, GRF, honest causal trees, AIPW with machine learning, doubly robust with machine learning, DR-Learner, T-Learner, S-Learner, X-Learner, meta-learners, heterogeneous treatment effects, conditional average treatment effect, CATE, HTE, high-dimensional controls, LASSO controls, post-LASSO, post-double selection, Belloni-Chernozhukov-Hansen, Riesz representer, Chernozhukov, sample splitting, econml, DoubleML package, or any combination of machine learning and causal inference.

インストール方法を見る

含まれるファイル(6)

  • SKILL.md8.5 KB
  • references/connections-traditional.md2.7 KB
  • references/dml.md7.3 KB
  • references/grf-meta-learners.md10.4 KB
  • references/high-dim-cross-fitting.md11.0 KB
  • references/hte-inference.md2.9 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Causal Machine Learning

Reference for semiparametric ML estimators: DML with cross-fitting, generalized random forests, debiased regularization, and nuisance function approximation. Covers Neyman-orthogonal moment conditions, sample splitting, plug-in bias correction, and heterogeneous treatment effects.

When to Use This Skill

Use when the user is:

  • Estimating treatment effects with high-dimensional controls (p large relative to n)
  • Interested in heterogeneous treatment effects (CATE) as a primary estimand
  • Applying ML for flexible nuisance function estimation within a causal framework
  • Implementing cross-fitting, sample splitting, or Neyman-orthogonal estimators
  • Using econml, DoubleML, or grf packages

Skip when:

  • Sample is small (n < 500 — ML nuisance models need data)
  • A well-specified parametric model is available and defensible
  • The task is standard IV/DiD/RDD without high-dimensional controls (use causal-inference skill)
  • Structural modeling is needed (use structural-modeling skill)
  • The task needs formal identification proof (use identification-proofs skill)

Where to Start

  • Choosing a method? Jump to Method Selection Guide
  • ATE with many controls? See references/dml.md
  • Heterogeneous treatment effects? See references/grf-meta-learners.md
  • Variable selection for controls? See references/high-dim-cross-fitting.md
  • Reporting HTE results? See references/hte-inference.md
  • Connecting to traditional methods? See references/connections-traditional.md

Causal ML vs Traditional Methods

DimensionTraditional (IV, DiD, RDD)Causal ML
Functional formParametricNonparametric / semi-parametric
High-dimensional controlsProblematicNative support
Heterogeneous effectsSecondary (subgroup analysis)Primary estimand (CATE)
Sample requirementsModerate NML nuisance needs large N
IdentificationExplicit (IV, DiD, RCT)Same assumptions — ML is estimation, not identification

Critical point: Causal ML does not relax identification assumptions. If you need a valid instrument, parallel trends, or no unmeasured confounding, those must still hold.


Double Machine Learning (DML)

DML (Chernozhukov et al. 2018) fixes regularization bias in naive ML-in-regression. Partial out controls X from both Y and D using separate ML nuisance models, then regress residuals. Two properties: Neyman orthogonality (moment condition locally insensitive to nuisance error) and cross-fitting (prevents overfitting bias).

PLR (Partially Linear Regression): $Y = \theta D + g(X) + \varepsilon$. Workhorse for continuous or binary D with ATE under selection on observables. IRM (Interactive Regression Model): relaxes additive separability for binary D with heterogeneous effects.

Full implementation (Python/R code, cross-fitting from scratch, diagnostics) in references/dml.md.

Causal Forests

Causal forests (Wager-Athey 2018; Athey-Tibshirani-Wager 2019) estimate CATE $\tau(x) = E[Y(1)-Y(0)|X=x]$ using honest forests (structure learned on one subsample, effects estimated on another). Use when CATE is the primary estimand and n $\geq$ 2,000. Always run the calibration test before reporting heterogeneity.

R (grf) and Python (econml) implementations, ATE/ATT extraction, BLP projections in references/grf-meta-learners.md.

Meta-Learners

Decompose CATE estimation into supervised learning sub-problems. DR-Learner (Kennedy 2023): best properties when both nuisance models are well-specified. T-Learner: simplest baseline. X-Learner: designed for imbalanced treatment. For applied work: DR-Learner primary, T-Learner benchmark. Large disagreement signals nuisance model problems.

All implementations in references/grf-meta-learners.md.

High-Dimensional Controls

PDS-LASSO (Belloni-Chernozhukov-Hansen 2014): separate LASSOes of Y on X and D on X, union of selected variables, then OLS. Works at moderate n (~200 with sparse confounders). See references/high-dim-cross-fitting.md.

HTE Inference

Before reporting CATE, test for genuine heterogeneity using BLP calibration test. Do not report heterogeneous effects if calibration test fails (p > 0.10). See references/hte-inference.md.


Method Selection Guide

Decision Heuristic

1. n < 500? → Use standard methods (causal-inference skill)
2. High-dim controls (p > 20), want ATE? → PDS-LASSO or DML-PLR; binary D → DML-IRM
3. CATE is primary estimand? → Causal Forest (large n) or DR-Learner (doubly robust)
4. Endogenous treatment with instrument? → DML-PLIV
5. Treatment is rare/imbalanced? → X-Learner
6. Quick benchmark? → Always compute T-Learner as baseline

Full Method Comparison

MethodEstimandPythonRMin nKey diagnostic
DML-PLRATEdoubleml, econmlDoubleML~500Nuisance R², residual balance
DML-IRMATE (binary D)doubleml, econmlDoubleML~500Propensity AUC, trim threshold
DML-PLIVLATEdoubleml, econmlDoubleML~1,000Effective F-stat
Causal ForestCATE(x)econmlgrf~2,000Calibration test, ATE match
DR-LearnerCATE(x)econml.drmanual/grf~1,000Propensity calibration
PDS-LASSOATE (high-dim X)sklearn + manualhdm~200Union size, penalty sensitivity
X-LearnerCATE (imbalanced D)econmlmanual~1,000Compare to DR-Learner

Limitations to State Explicitly

  • ML needs data: Causal forests need n $\geq$ 2,000; DML needs n $\geq$ 500. Below these, use parametric methods.
  • Identification is not relaxed: ML is better nuisance estimation, not weaker assumptions.
  • CATE inference is hard: Individual-level CIs are conservative; policy targeting requires care.
  • Publication: DML and causal forests are mainstream in top applied micro journals. Compare to traditional estimators.

Connections to Traditional Methods

Causal ML nests traditional estimators: DML with linear nuisance = OLS (Frisch-Waugh), DML + IV = PLIV, causal forests + instrument = heterogeneous LATE (grf::instrumental_forest), post-LASSO + many instruments = sparse instrument selection then 2SLS. Details in references/connections-traditional.md.


Integration with Plugin

Agents: econometric-reviewer (post-estimation review, table/code consistency), identification-critic (IV/PLIV assumptions), numerical-auditor (convergence, seeding, Monte Carlo validation).

Cross-references: empirical-playbook skill → sensitivity-analysis.md (specification curve over ML choices), empirical-playbook skill → diagnostic-battery.md (nuisance R², overlap, calibration), numerical-auditor agent (synthetic data with known CATE).

Relationship to causal-inference skill: Use causal-inference to establish identification; use causal-ml for implementation with high-dimensional controls or when heterogeneity is primary. Complements, not substitutes.

Reference Files

  • references/dml.md — Full DML implementation: PLR, IRM, PLIV with econml/DoubleML, cross-fitting, diagnostics
  • references/grf-meta-learners.md — Causal forests (grf/econml), DR/T/S/X-Learner, calibration tests
  • references/high-dim-cross-fitting.md — PDS-LASSO, Belloni-Chernozhukov-Hansen, cross-fitting protocols
  • references/hte-inference.md — Calibration tests, individual CATE CIs, BLP projections, subgroup analysis
  • references/connections-traditional.md — DML-OLS equivalence, PLIV, instrumental forests, post-LASSO

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

a1

無料

VS-Enhanced Research Question Refiner - Prevents Mode Collapse and derives differentiated research questions Enhanced VS 3-Phase process: Modal question avoidance, alternatives presentation, differentiated RQ recommendation Use when: refining research ideas, formulating research questions, clarifying scope Triggers: research question, 연구 질문, PICO, SPIDER, research idea

日本語の概要は準備中です。原文の説明を表示しています。

brycewang-stanford/Auto-Empirical-Research-Skills4,6042026年10月12日 更新

a2

無料

VS-Enhanced Theoretical Framework Architect with Critique & Visualization Full VS 5-Phase process: Modal theory avoidance, Long-tail exploration, differentiated framework presentation Absorbed A3 (Devil's Advocate) critique and A6 (Conceptual Framework Visualizer) capabilities Use when: building theoretical foundations, designing conceptual models, deriving hypotheses, critiquing frameworks, visualizing models Triggers: theoretical framework, 이론적 프레임워크, conceptual model, 개념적 모형, hypothesis derivation, critique, devil's advocate, 반론, visualization, diagram

日本語の概要は準備中です。原文の説明を表示しています。

brycewang-stanford/Auto-Empirical-Research-Skills4,6042026年10月12日 更新

a5

無料

Agent A5 - Paradigm & Worldview Advisor - Philosophical foundations for research design. Covers ontology, epistemology, axiology, and methodology alignment. Use when: establishing philosophical foundations, justifying methodological choices, writing positionality statements Triggers: paradigm, 패러다임, ontology, epistemology, worldview, 세계관, philosophical foundations, 철학적 기초

日本語の概要は準備中です。原文の説明を表示しています。

brycewang-stanford/Auto-Empirical-Research-Skills4,6042026年10月12日 更新

Academic paper writing skill with 12-agent pipeline. v2.5: Style Calibration (learn author's writing voice from past papers) + Writing Quality Check (writing quality checklist for natural prose). Supports IMRaD, literature review, theoretical, case study, policy brief, and conference paper structures. APA 7.0 (default), Chicago, MLA, IEEE, Vancouver citation formats. Bilingual abstracts (zh-TW + EN). Multi-format output (LaTeX, DOCX, PDF, Markdown). Triggers on: write paper, academic paper, paper outline, write abstract, revise paper, check citations, convert to LaTeX, guide my paper, parse reviews, revision roadmap, 寫論文, 學術論文, 論文大綱, 寫摘要, 修改論文, 檢查引用, 引導我寫論文, 帶我規劃論文, 逐章規劃, 論文架構, 審查意見, 修訂路線圖.

日本語の概要は準備中です。原文の説明を表示しています。

brycewang-stanford/Auto-Empirical-Research-Skills4,6042026年10月12日 更新

Systematic writing framework for philosophy and interdisciplinary academic papers from optimized outline to submission-ready manuscript. Use when users want to: (1) write a paper from a detailed outline, (2) ensure quality control during writing, (3) maintain consistency across chapters, (4) prepare a submission-ready manuscript, or (5) systematically execute a planned paper. Triggered by phrases like 'write the paper from this outline,' 'compose the full manuscript,' 'execute the outline,' or when users have completed strategic planning (academic-paper-strategist skill) and are ready to write. Takes optimized outline as input; outputs complete manuscript with iterative quality checks.

日本語の概要は準備中です。原文の説明を表示しています。

brycewang-stanford/Auto-Empirical-Research-Skills4,6042026年10月12日 更新

Multi-perspective academic paper review with dynamic reviewer personas. Simulates 5 independent reviewers (EIC + 3 peer reviewers + Devil's Advocate) with field-specific expertise. Supports full review, re-review (verification), quick assessment, methodology focus, and Socratic guided modes. Triggers on: review paper, peer review, manuscript review, referee report, review my paper, critique paper, simulate review, editorial review.

日本語の概要は準備中です。原文の説明を表示しています。

brycewang-stanford/Auto-Empirical-Research-Skills4,6042026年10月12日 更新

brycewang-stanford のスキルをすべて見る

このスキルの問題を報告する