Skip to content

R-learner and Robinson decomposition

Separate the outcome forecast from a heterogeneous treatment effect, fit cross-fitted residuals with R-loss, and see how overlap and regularisation change the problem.

The R-learner estimates a treatment-effect function by fitting the relationship between residualised outcomes and residualised treatment assignments. The Robinson decomposition is the population identity behind that fit. For a quant comparing two execution policies, it separates predictable cost differences associated with order characteristics from the cost change attributed to the policy, under explicit causal assumptions.
The target is a conditional average treatment effect, not a prediction of the observed outcome and not an individual order's unobserved counterfactual.

Remove the outcome mean, not the untreated baseline

Let D∈{0,1}D\in\{0,1\} identify the policy, YY denote execution cost in basis points, and XX contain pre-treatment order characteristics. Define

e(x)=P(D=1∣X=x),m(x)=E[Y∣X=x],μd(x)=E[Y∣X=x,D=d],τ(x)=μ1(x)−μ0(x).\begin{aligned} e(x)&=\mathbb{P}(D=1\mid X=x),\\ m(x)&=\mathbb{E}[Y\mid X=x],\\ \mu_d(x)&=\mathbb{E}[Y\mid X=x,D=d],\\ \tau(x)&=\mu_1(x)-\mu_0(x). \end{aligned}
Here ee is the propensity score. By conditional expectation,
m(x)=μ0(x)+e(x)τ(x).m(x)=\mu_0(x)+e(x)\tau(x).
Thus m(x)m(x) is the observed outcome mean mixing both policies. It is not the untreated response μ0(x)\mu_0(x). Subtracting it from Y=μ0(X)+Dτ(X)+εY=\mu_0(X)+D\tau(X)+\varepsilon, where E[ε∣X,D]=0\mathbb{E}[\varepsilon\mid X,D]=0, gives
Y−m(X)={D−e(X)}τ(X)+ε.Y-m(X)=\{D-e(X)\}\tau(X)+\varepsilon.
Nie and Wager, §2, use this Robinson residualisation identity to construct the R-learner. Robinson's original setting estimated a constant coefficient in a partially linear model; here the coefficient can vary with XX.
The algebra describes conditional observed means. Its causal interpretation additionally needs consistent potential outcomes, a well-defined treatment without interference, no unmeasured confounding conditional on XX, and overlap. Residualisation cannot establish those assumptions. In the execution example, policy choices based on unrecorded urgency could invalidate the causal interpretation.

Fit residuals with an effect-specific loss

Use cross-fitting to obtain each row's nuisance predictions from models trained outside its fold. Write
ri=Yi−m^(−k(i))(Xi),di=Di−e^(−k(i))(Xi).r_i=Y_i-\hat m^{(-k(i))}(X_i),\qquad d_i=D_i-\hat e^{(-k(i))}(X_i).
Then minimise the R-loss, with a complexity penalty on the candidate effect function gg:
τ^∈argmin⁡g{1n∑i=1n{ri−dig(Xi)}2+Λ(g)}.\hat\tau\in\operatorname*{argmin}_{g} \left\{\frac1n\sum_{i=1}^n\{r_i-d_i g(X_i)\}^2+\Lambda(g)\right\}.

This is a loss framework, not a particular tree or neural network. A constant g(x)=tg(x)=t fits one effect; a richer class can learn heterogeneity. Out-of-fold nuisance fitting prevents each row from helping construct its own nuisance prediction. It does not by itself supply a valid dependence model for repeated orders, firms or trading days.

For the unpenalised constant fit, differentiation gives

t^=∑idiri∑idi2,∑idi2>0.\hat t=\frac{\sum_i d_i r_i}{\sum_i d_i^2}, \qquad \sum_i d_i^2>0.

This is a slope through the origin in residual space, not generally the raw difference between treated and untreated outcome means.

Two rows reveal the mechanics

Suppose held-out nuisance predictions produce the following fictional residuals. These are stipulated inputs, not an estimated causal study.

RowTreatment residual did_iCost residual rir_i (bps)
A−0.5−1
B0.51

The cross-product sum is 11, and the squared treatment-residual sum is 0.50.5. The fitted constant is therefore 22 bps, with both residual errors exactly zero. A positive effect means higher execution cost under policy 1 under the stated sign convention.

For these two rows the mean R-loss is 14(t−2)2\tfrac14(t-2)^2. If we deliberately add the penalty Λ(t)=14t2\Lambda(t)=\tfrac14t^2, the objective becomes

14(t−2)2+14t2=12(t−1)2+12.\frac14(t-2)^2+\frac14t^2 =\frac12(t-1)^2+\frac12.

Its minimum is now t=1t=1 bps. The unpenalised R-loss there is 0.250.25 bps squared, and the total objective is 0.50.5 bps squared. Penalty choice changes the answer even though the nuisance residuals are unchanged. Neither fit establishes generalisation from two observations.

Fictional cost residuals minus 1 and 1 bps against treatment residuals minus 0.5 and 0.5 lie on a line of slope 2 bps. Mean R-loss is zero at effect 2. Adding a penalty of 0.25 times the squared effect moves the minimum to effect 1, with penalised objective 0.5 bps squared.
Fictional cost residuals minus 1 and 1 bps against treatment residuals minus 0.5 and 0.5 lie on a line of slope 2 bps. Mean R-loss is zero at effect 2. Adding a penalty of 0.25 times the squared effect moves the minimum to effect 1, with penalised objective 0.5 bps squared.
Original two-row residual calculation. The right panel uses mean R-loss and a specified quadratic penalty; the dashed curve includes the penalty.

What low R-loss can hide

With the true nuisances and finite second moments, expand the squared residual and use the zero conditional mean of ε\varepsilon. The excess population R-loss for a candidate gg is

L(g)−L(τ)=E[e(X){1−e(X)}{g(X)−τ(X)}2].L(g)-L(\tau) =\mathbb{E}\left[e(X)\{1-e(X)\}\{g(X)-\tau(X)\}^2\right].

This identity exposes the weighting: errors where assignment is nearly deterministic contribute little to the loss. With no overlap, some effects are unidentified; with weak overlap, a low aggregate loss can coexist with poor effect estimates in those regions. Restricting the function class or adding a penalty also trades fit against complexity, so the fitted effect need not equal the unrestricted population target.

The local nuisance-error protection is related to Neyman orthogonality. It does not promise accurate effects from arbitrary nuisance models. Nie and Wager's quasi-oracle theorem concerns a specific penalised kernel learner under overlap, nuisance-rate and uniform-consistency conditions, boundedness and kernel/smoothness restrictions, and a suitable penalty. It is not a universal oracle guarantee for any R-learner implementation; see §5, Theorem 3.
For the residual's mean-zero foundation, the owned Conditional Expectation lesson develops the tower property and squared-error projection. Its preview is public; the full lesson requires membership.

Sources

Last updated
  • causal inference
  • heterogeneous treatment effects
  • residualisation
  • r loss
← Back to the glossaryBack to top ↑