@misc{grf,
title = {grf},
author = {Athey and Tibshirani and Wager},
howpublished = {\url{https://grf-labs.github.io/grf/}},
note = {Software / documentation}
}When the conditional mean is smooth: regression forest baseline → ll_regression_forest → tuning → diagnostics.
Input · what goes in
Outcome Y with a smooth dependence on continuous covariates X.
Show data format & exampleHide example
Format — one row per unit. A covariate matrix X and an outcome Y (no treatment needed).
X1 X2 X3 Y
0.42 -1.1 0.2 3.10
-0.07 0.6 -0.5 1.85
1.20 0.3 0.1 4.02
Pipeline · the recipe ⑂ has parallel branches
↑ Click any step in the diagram to read its logic, code, assumptions & discussion.
[GRF] Regression forest
The core estimate — where the causal quantity itself is computed.
Baseline E[Y|X] fit — establish the score to beat.
Regression forest — Honest non-parametric regression for E[Y|X], with out-of-bag predictions and pointwise CIs.
rf <- regression_forest(X, Y)
Y.hat <- predict(rf)$predictions
- No comments on this step yet — be the first.
Log in to comment on this step.
[GRF] Local linear forest
The core estimate — where the causal quantity itself is computed.
Fit with a chosen set of `linear.correction.variables` (typically the smoothest covariates).
Local linear forest — Random forest with a local linear correction — smoother fits and better extrapolation for smooth signals.
llf <- ll_regression_forest(X, Y)
predict(llf, X.test, linear.correction.variables = 1:ncol(X))
- No comments on this step yet — be the first.
Log in to comment on this step.
Tune λ via cross-validation
A pre-flight check — run this before trusting any estimate downstream.
GRF ships `tune.ll.regression.forest`-style CV; pick the ridge penalty that minimizes held-out MSE.
- No comments on this step yet — be the first.
Log in to comment on this step.
Calibration & boundary plot
A pre-flight check — run this before trusting any estimate downstream.
Predicted vs observed near covariate boundaries — where local linear typically beats plain forests.
- No comments on this step yet — be the first.
Log in to comment on this step.
Side-by-side comparison
Reporting — turn the numbers into a figure or table a reader can act on.
MSE table and overlaid prediction curves; show where llf wins and where it doesn't matter.
- No comments on this step yet — be the first.
Log in to comment on this step.
Output · what you get 5 figures
Figures reproduced from grf — Athey, Tibshirani & Wager — unofficial community showcase; all credit to the original authors.
The GRF 'Local linear forests' tutorial. The plain forest can show staircase artifacts near boundaries and on smooth signals; the local linear correction smooths these out and improves extrapolation. Unofficial summary.
Discussion (0)
Log in to join the discussion.