Top News
Saturday , 28 November 2026
Home Artificial intelligence How Accurately Can Treatment Effects Be Estimated When Removing Confounding with Machine Learning? The Linear Regression Bias of 0.51 Disappeared, but Bias Remained Even with Cross-Fitting When the Learner Was Weak
Artificial intelligence

How Accurately Can Treatment Effects Be Estimated When Removing Confounding with Machine Learning? The Linear Regression Bias of 0.51 Disappeared, but Bias Remained Even with Cross-Fitting When the Learner Was Weak

Share


What You Will Learn from This Article

Double/Debiased Machine Learning (DML) is a method that uses machine learning to remove confounding (factors affecting both the outcome and the treatment) while estimating treatment effects with valid standard errors. In a simulation where the true effect was known, we compared linear regression, orthogonalization without cross-fitting, and DML. Of the two key innovations of DML, “orthogonalization” had a major impact, while the effectiveness of “cross-fitting” depended on how well the machine learning model performed.

Paper Reviewed

  • Victor Chernozhukov, Denis Chetverikov, Mert Demirer, Esther Duflo, Christian Hansen, Whitney Newey, James Robins (2018) “Double/debiased machine learning for treatment and structural parameters,” The Econometrics Journal 21(1). https://arxiv.org/abs/1608.00060

The Paper’s Core Question

When confounding factors are numerous or their effects are non-linear, linear regression cannot fully remove them. Machine learning can capture non-linear relationships. However, if predictions from machine learning are directly used to estimate treatment effects, regularization (restraints to prevent overfitting) and overfitting cause the estimates to be biased, and the confidence intervals become invalid. The paper demonstrates how machine learning can be used to properly estimate treatment effects.

The Paper’s Approach

  • Orthogonalization (partialing out from both sides): Machine learning is used to subtract the “portion explainable by X” from the outcome Y, and also to subtract the “portion explainable by X” from the treatment D. The remaining residuals of Y are then regressed on the remaining residuals of D. By partialing out from both sides, small errors in the machine learning models have almost no impact on the effect estimate (because the errors only enter as a product).

  • Cross-fitting: The data is split, and residuals for a given subset are calculated using models trained on the other subsets. If you train on your own data and generate your own residuals, overfitting shrinks the residuals and biases the estimates.

  • Condition: The errors of the two machine learning models (predicting Y and predicting D) must be sufficiently small. Each model can be relatively coarse on its own, but the product of the two errors must be small.

Hands-on Experiment

  • Partially linear model: Y = 0.5×D + 1.5×h(X) + noise, D = h(X) + noise. h(X) is a non-linear function involving sine, squares, and multiplication, with X having 5 columns. The true effect is 0.5. Evaluated over 100 iterations with fixed random seeds on 1,000 observations.

  • Five methods compared: Linear regression (entering X linearly) / Orthogonalization with LightGBM without cross-fitting / DML with LightGBM (5 folds) / Orthogonalization with a deep random forest down to 1 sample per leaf without cross-fitting / DML with the same random forest.

  • Standard errors were derived from the residual regression formula, and we calculated the proportion of times the 95% confidence interval contained 0.5.

Image

For linear regression, (estimate − true value) / standard error was around 15, and it is plotted grouped at 8 on the far right in the figure.

Key Findings

1. Linear regression showed substantial bias, which disappeared with orthogonalization. The mean estimate for linear regression was 1.007 (bias of +0.51), and the true value fell within the 95% confidence interval 0% of the time. When partialing out from both sides with LightGBM, the estimate was 0.498 without cross-fitting and 0.512 with DML.

2. The effect of cross-fitting was minor. With LightGBM, there was virtually no difference between omitting cross-fitting (coverage rate of 91%) and using DML (88%). We attribute this to LightGBM’s setting of incrementally adding trees, which made it less prone to memorizing the training data (speculation).

3. When the learner was weak, bias remained even with cross-fitting. For the deep random forest, the bias was +0.068 without cross-fitting (coverage rate of 44%) and +0.094 with DML (25%). The random forest could not fully capture the non-linear curvature of h(X), causing the same uncaptured confounding to enter the residuals of both Y and D and shifting the estimate upward. Applying cross-fitting reduced the amount of data available for training, which actually increased the uncaptured error.

Limitations of the Paper and Pitfalls Revealed by the Experiment

  • The theoretical guarantees of the paper assume that “the machine learning models predict sufficiently well.” If the prediction performance is poor, as with our deep random forest, DML will not produce correct intervals either.

  • The only way to know which learner is best is to check with each dataset. It is important to report how well Y and D are predicted (the error from cross-fitting).

  • It is assumed that all confounding factors are included in X. Unobserved confounders cannot be removed even with DML.

If You Use It at Work

  • When estimating policy effects using regression, if the effect of confounders appears to be non-linear, compare it side by side with DML. If the results differ significantly, question the functional form of the linear regression.

  • Try 2 to 3 types of learners to predict Y and D, and observe how much the effect estimate fluctuates.

  • DML was also used in F16 (nursery schools and women’s employment) in this repository. There, too, we look at changes when switching learners.

Related Papers and Further Reading

  • Wager, Athey (2018) Causal Forests: Individualized effects. Tested in P05.

  • Description of the “DoubleML” Python package by Bach et al. (implementation and usage)

  • Chernozhukov et al. (2022) “Locally robust semiparametric estimation,” Econometrica (general theory of orthogonalization)

Notes on Terminology

  • Confounding: Factors that affect both whether a policy is received and the outcome. Left unaddressed, the effect of the policy gets mixed up with the effect of these factors.

  • Partially Linear Model: A formulation that represents the outcome as the sum of “policy effect × policy” and “the part determined by the factors.” The part determined by the factors can take any functional form.

  • Orthogonalization: Comparing the outcome and policy only after subtracting the portion explained by factors from both. This makes machine learning errors less likely to contaminate the effect estimate.

  • Cross-fitting: Splitting the data and generating predictions for one portion using a model trained on a different portion. A technique to avoid using predictions that have simply memorized their own data.

  • Standard Error: A measure of how much an estimate fluctuates depending on how data is sampled. Roughly ±1.96 times this gives the 95% confidence interval.

What Cannot Be Concluded

  • This is not a replication of the paper’s experiments; rather, I tested the same concept using short code I wrote myself (I did not use packages like DoubleML).

  • This is based on only a single setup (1,000 observations, 5 columns, 1 type of non-linearity). If the sample size increases, the bias of the random forest should also decrease (conjecture).

  • The coverage rate was calculated from 100 runs, with fluctuations of around ±5 percentage points.

All data, code, and figures are available on GitHub: https://github.com/takayuki-0127/japan-open-data-notes/tree/main/papers/P04_double_ml



Source link

Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Articles
Artificial intelligence

iProov urges UK to target infrastructure behind AI disinformation

The UK government has announced plans for a center to counter hostile-state...

Artificial intelligence

Pizza history: AI agent’s cardless purchase is a first for UK

An order of Papa John’s margherita pizzas has become the first purchase...

Artificial intelligence

AI shopping agents from OpenAI, Meta, Google hit retailer blocks

Maia Bittner urgently needed to replace her car's windshield wipers. So last...

Artificial intelligence

How to remove Muse on WhatsApp if you don’t want to use the new AI Agent

WHATSAPP has introduced a new AI feature called Muse as an extra...