@misc{grf,
title = {grf},
author = {Athey and Tibshirani and Wager},
howpublished = {\url{https://grf-labs.github.io/grf/}},
note = {Software / documentation}
}Causal forest → doubly-robust scores → policytree → evaluate policy value → plot the tree.
Input · what goes in
Per-unit CATEs / doubly-robust scores from a causal forest, plus a cost.
Show data format & exampleHide example
Format — one row per unit. A covariate matrix X (numeric), a binary treatment W ∈ {0,1}, and an outcome Y.
X1 X2 X3 W Y
0.42 -1.1 0 1 3.10
-0.07 0.6 1 0 1.85
1.20 0.3 0 1 4.02
Pipeline · the recipe
↑ Click any step in the diagram to read its logic, code, assumptions & discussion.
[GRF] Causal forest
The core estimate — where the causal quantity itself is computed.
Estimate CATEs and the AIPW score for each unit.
Causal forest — Honest random forest for heterogeneous treatment effects — CATE for a binary treatment via GRF moment conditions.
cf <- causal_forest(X, Y, W) # Y.hat, W.hat cross-fit
tau.hat <- predict(cf)$predictions # OOB CATEs
- No comments on this step yet — be the first.
Log in to comment on this step.
double_robust_scores()
Data preparation — shapes the raw inputs into what the estimator expects.
Build the doubly-robust reward matrix policytree maximizes over.
dr.scores <- double_robust_scores(cf) # n × K reward matrix
- No comments on this step yet — be the first.
Log in to comment on this step.
policytree: depth-2 optimal tree
The core estimate — where the causal quantity itself is computed.
Learn an interpretable assignment rule that maximizes expected welfare.
library(policytree)
tree <- policy_tree(X, dr.scores, depth = 2)
plot(tree)
- No comments on this step yet — be the first.
Log in to comment on this step.
Evaluate policy value (held-out)
Uncertainty quantification — standard errors, intervals, and aggregation.
Estimate the value of the learned rule vs treat-all / treat-none on held-out data.
# value of the learned rule vs treat-all / treat-none on held-out data
mean(dr.scores[cbind(seq_len(n), predict(tree, X))])
- No comments on this step yet — be the first.
Log in to comment on this step.
Plot the learned decision tree
Reporting — turn the numbers into a figure or table a reader can act on.
Show the tree and the value comparison.
- No comments on this step yet — be the first.
Log in to comment on this step.
Output · what you get
Figures reproduced from grf — Athey, Tibshirani & Wager — unofficial community showcase; all credit to the original authors.
The GRF + policytree tutorial: turn CATEs into an interpretable, near-optimal treatment rule and honestly evaluate its value. Unofficial summary; policytree is a separate grf-labs package.
Discussion (2)
Log in to join the discussion.
Depth-2 trees hit the sweet spot: near-optimal but you can actually explain the rule to ops. The held-out value evaluation keeps you honest.
The 'evaluate vs treat-all/treat-none' baseline is what convinces stakeholders. Always include it.
Doubly-robust scores as the policytree reward is the key link. Garbage scores → garbage policy.