Why a Causal Forest Is Not Just an Outcome-Prediction Forest
A prediction model asks what outcome is likely for a unit with particular covariates. A causal model asks a different question: how would that unit’s outcome change under treatment rather than control? This distinction matters when treatment is not randomly assigned, when treatment effects vary across people, or when a prediction is intended to guide a decision.
A causal forest uses trees to build neighborhoods that adapt to the covariates. It then uses observations in those neighborhoods to estimate a treatment effect, rather than merely averaging their outcomes. The forest’s structure determines which observations are locally relevant; a causal estimating equation determines how their treatment and outcome information contributes to the effect estimate.
For the usual identification argument, assume consistency (the observed outcome is \(Y=Y(W)\), where \(W\) is the treatment received), conditional exchangeability \((Y(1),Y(0))\perp W\mid X\), and positivity \(0<P(W=1\mid X=x)<1\) for covariate values of interest. These assumptions let us identify conditional effects from observed data. A forest cannot make them true: it is an estimation method, not a substitute for a credible causal design or adequate covariate measurement.
From Tree Leaves to Adaptive Neighborhoods
A tree partitions the covariate space into leaves. For a target covariate value \(x\), the observations in the same leaf as \(x\) form a neighborhood. Unlike a fixed-radius neighborhood, its shape and size are determined by the tree’s partitions. A forest averages this information across many trees, which generally gives a smoother neighborhood than relying on one partition.
A convenient way to express the resulting neighborhood is with forest weights. An observation receives weight when it shares a leaf with the target; observations that share leaves with \(x\) more often generally receive greater weight. One common definition gives each observation in a target’s leaf an equal share of that tree’s weight, then averages those shares over trees. The weights are nonnegative and sum to one.
Worked Example: Calculating Forest Weights From Three Trees
Suppose a hypothetical forest has five training observations and three trees. For a target \(x\), the leaves containing \(x\) contain observations \(\{1,2,3\}\), \(\{2,3,4\}\), and \(\{1,3,4,5\}\), respectively. Within each tree, each observation in the target leaf receives weight equal to the reciprocal of that leaf’s size; the forest weight is the average of the three tree-specific weights.
Observation 1 appears in leaves of sizes 3 and 4, so \( \alpha_1(x)=[1/3+0+1/4]/3=7/36\). Observation 2 appears in two leaves of size 3, so \( \alpha_2(x)=[1/3+1/3+0]/3=2/9=8/36\). Observation 3 appears in all three leaves, so \( \alpha_3(x)=[1/3+1/3+1/4]/3=11/36\). Observation 4 appears in leaves of sizes 3 and 4, so \( \alpha_4(x)=7/36\). Observation 5 appears only in the leaf of size 4, so \( \alpha_5(x)=[0+0+1/4]/3=1/12=3/36\).
The weights sum to \( (7+8+11+7+3)/36=1\). Observation 3 has the largest weight because it shares the target leaf in every tree. This example describes a neighborhood, not yet a treatment effect: the weights must be combined with treatment and outcome information using an appropriate causal estimating equation.
A Local Orthogonalized Treatment-Effect Equation
One common causal-forest formulation uses an orthogonalized local moment. Let \(e(x)=P(W=1\mid X=x)\) be the propensity score and \(m(x)=E[Y\mid X=x]\) the conditional mean of the observed outcome. The centered treatment \(W-e(X)\) and centered outcome \(Y-m(X)\) help separate treatment-related variation from predictable variation associated with the covariates.
Here is a short justification. Conditional on \(X=x\), write \(\mu_w(x)=E[Y(w)\mid X=x]\). Exchangeability and consistency imply \(E[Y\mid W=w,X=x]=\mu_w(x)\). Also, \(E[W-e(x)\mid X=x]=0\), so subtracting \(m(x)\) from \(Y\) does not change the conditional expectation of the product with \(W-e(x)\). Since \(W\) is binary,
The conditional treatment effect is \(\mu_1(x)-\mu_0(x)\). Also, the conditional variance of a binary treatment is \(E[(W-e(x))^2\mid X=x]=e(x)(1-e(x))\). Combining these identities proves the result. Positivity ensures this denominator is nonzero.
A forest replaces exact conditioning on \(X=x\) with its adaptive neighborhood. A corresponding local estimate is the weighted solution \(\hat{\tau}(x)\) to the sample moment equation below. Here \(\hat e(X_i)\) and \(\hat m(X_i)\) are estimates of the propensity and outcome regressions; known quantities, such as a propensity in a randomized trial, can be used when appropriate.
Solving this equation gives
The numerator is a locally weighted covariance-like quantity between residualized treatment and residualized outcome. The denominator measures locally weighted residual treatment variation. This is not simply the difference between the weighted mean outcome of treated observations and the weighted mean outcome of controls. The residualization accounts for the modeled relationship of treatment and outcome with covariates, while the forest weights localize the calculation around \(x\).
The orthogonalized equation is closely related to the doubly robust approach to conditional effects: its moment uses both treatment and outcome nuisance functions, and its local target is a treatment effect. In practice, nuisance estimation and forest construction must be handled in ways appropriate to the data and estimator. The formula alone does not guarantee a reliable estimate if the identifying assumptions fail, nuisance estimates are poor, or the local neighborhood has little treatment variation.
Worked Example: Computing a Forest-Weighted Local Effect
Consider four hypothetical observations receiving forest weights \(0.40,0.30,0.20,0.10\) for a target \(x\). Suppose the estimated propensity is \(0.50\) for each observation. The observed outcomes \(Y_i\) are \(12,7,15,8\), and the corresponding estimated outcome means \(\hat m(X_i)\) are \(10,8,12,9\). Use the local orthogonalized equation to estimate the effect.
For observation 1, \(W_1=1\), so its residualized treatment is \(1-0.50=0.50\), and its residualized outcome is \(12-10=2\). Its contribution to the numerator is \(0.40(0.50)(2)=0.40\).
For observation 2, \(W_2=0\), giving residualized treatment \(-0.50\) and residualized outcome \(7-8=-1\). Its numerator contribution is \(0.30(-0.50)(-1)=0.15\).
For observation 3, \(W_3=1\), giving residualized treatment \(0.50\) and residualized outcome \(15-12=3\). Its contribution is \(0.20(0.50)(3)=0.30\).
For observation 4, \(W_4=0\), giving residualized treatment \(-0.50\) and residualized outcome \(8-9=-1\). Its contribution is \(0.10(-0.50)(-1)=0.05\). The numerator is therefore \(0.40+0.15+0.30+0.05=0.90\).
Each squared residualized treatment is \(0.25\), so the denominator is \(0.40(0.25)+0.30(0.25)+0.20(0.25)+0.10(0.25)=0.25\). Thus \( \hat{\tau}(x)=0.90/0.25=3.60\). Under the identifying assumptions and the specified nuisance estimates, this is an estimated local average treatment effect of 3.60 outcome units for covariates near \(x\). It is not a claim that every individual in that neighborhood would benefit by exactly 3.60 units.
Effect Estimation Versus Outcome Prediction
The distinction is clearest when the same covariate neighborhood is used for two different targets. An outcome predictor estimates an outcome under the observed treatment pattern, or it may estimate an outcome conditional on a specified treatment value. A causal effect compares outcomes under treatment and control for the same covariate-defined group. A weighted average of observed outcomes does not, by itself, make that comparison.
Worked Example: A Local Outcome Mean Is Not the Local Effect
Suppose a hypothetical randomized study has four participants with the same covariate profile. Two are assigned treatment and have outcomes 8 and 10; two are assigned control and have outcomes 6 and 8. Assume consistency and random assignment within this profile, so treatment assignment is independent of potential outcomes and both treatment groups are represented.
The treated mean is \((8+10)/2=9\), and the control mean is \((6+8)/2=7\). The estimated local treatment effect is the contrast \(9-7=2\) outcome units.
If the target is instead the mean observed outcome under this study’s treatment allocation, it is \((8+10+6+8)/4=8\) outcome units. This value describes the observed outcome level in the mixed treatment group; it is not the treatment effect. Subtracting the outcome mean from a reference value, or reporting the weighted outcome mean as the causal benefit, would answer a different question. In a real sample, the estimated contrast can also be noisy, even when randomization identifies the causal comparison in expectation.
Causal forests matter when effects may vary with covariates and a single overall average could conceal useful differences. Their adaptive neighborhoods allow nearby observations to contribute more than distant ones without requiring the analyst to specify every interaction in advance. But the estimate remains a local average, not an individual-specific causal effect, and its meaning depends on the covariates used, the treatment assignment mechanism, and the quality of the available comparisons.
Local overlap deserves particular attention. If almost everyone in a target neighborhood received treatment, or almost everyone received control, the denominator in the local equation can be small. Dividing by a small quantity can make the estimate highly sensitive to a few observations or to nuisance-estimation error. A forest can adapt its neighborhoods, but it cannot create treatment-control information where the data provide little.
Common Mistake: Reading a Causal Forest as a Predictor
A common mistake is to say, “The forest predicts an outcome of 8 in this neighborhood, so treatment changes the outcome by 8.” That reasoning confuses an outcome level with a treatment contrast. The correction is to name the estimand first: an outcome prediction concerns \(E[Y\mid X=x]\) or a treatment-specific outcome mean, whereas a conditional treatment effect concerns \(E[Y(1)-Y(0)\mid X=x]\). Estimate and report the comparison between treatment and control, using an identification strategy and an estimator suited to the data.
A second related mistake is to interpret large forest weights as evidence of causality. Weights describe which observations the forest treats as locally relevant. They do not establish exchangeability, positivity, or correct measurement of confounders. Those are assumptions about the design and data, not properties guaranteed by a flexible prediction algorithm.
Check Your Understanding
Use these questions to check whether you can distinguish forest neighborhoods, causal effects, and outcome predictions.
- In your own words, what does a forest weight \(\alpha_i(x)\) represent, and what does it not establish?
- Why does the local orthogonalized effect equation divide by a weighted sum of squared residualized treatment?
- If treatment and control observations have nearly identical outcomes in a neighborhood, what contrast is being estimated? What additional information is needed to interpret it causally?
- Why is a weighted mean of observed outcomes generally not equal to a conditional treatment effect?
- What problem can arise when a target neighborhood has very little variation in treatment assignment?