Skip to content

Correct the R-learner interpretation for nonlinear treatments - #491

Open
AliFozooni wants to merge 1 commit into
matheusfacure:masterfrom
AliFozooni:agent/correct-r-learner-interpretation
Open

Correct the R-learner interpretation for nonlinear treatments#491
AliFozooni wants to merge 1 commit into
matheusfacure:masterfrom
AliFozooni:agent/correct-r-learner-interpretation

Conversation

@AliFozooni

Copy link
Copy Markdown

Summary

  • clarify that the R-learner is flexible in pre-treatment covariates X, not automatically in the treatment level
  • replace the treatment-as-feature fit with the correct constant residual-on-residual slope for the no-X simulation
  • distinguish a best global linear projection from a local derivative of a nonlinear dose-response
  • regenerate the comparison plot to show the fitted global slope against the true marginal-effect curve
  • correct the later residual direction, prediction notation, indexing text, and causal caveats for the heuristic nonlinear model

Why this matters

The previous example supplied residualized treatment as the final learner feature and interpreted its predictions as treatment-level derivatives. In the partially linear R-learner, however, the final model estimates tau(X). With no pre-treatment X in this simulation, that target is one best-fitting slope over the observed treatment distribution. A flexible model of the pseudo-outcome on treatment changes the estimand and does not identify a local derivative.

The revised example makes that distinction visible in both the derivation and plot, while retaining the later nonlinear residual-prediction model as an explicitly labeled heuristic rather than assigning it R-learner guarantees.

Validation

  • regenerated only the two affected code-cell outputs with synchronized execution counts
  • built the full Jupyter Book successfully
  • visually inspected the corrected figure
  • validated notebook JSON and checked the diff for whitespace errors

Closes #125
Closes #352
Closes #392
Closes #412
Closes #425

@AliFozooni
AliFozooni marked this pull request as ready for review August 15, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant