Causal inference
AIPW, Orthogonal Scores, and Double Robustness
Understand augmented inverse probability weighting, influence functions, orthogonality, cross-fitting, and the real scope of double robustness.
By the end you can
- Explain the AIPW estimator as regression plus a weighted residual correction
- State the precise meaning of double robustness
- Explain orthogonality and cross-fitting at an intuitive level
- Diagnose nuisance-model, overlap, and influence failures
Example
The trial where the robust estimator lost to the model it was protecting
Somebody ran the experiment the label on the tin invites you to skip. Kang and Schafer drew 1,000 samples of n=200 and n=1,000 from an artificial population whose true mean was mu=210. That was in 2007. They estimated that mean three ways: with doubly robust estimators, with plain regression, and with inverse probability weighting. They did it under correct and misspecified nuisance models alike.
Where one model was right, the promise held. Pure inverse probability weighting with a correctly specified propensity model came in at bias -0.01 and RMSE 1.81 at n=1,000. Misspecify the propensity model and the same estimator gave bias 5.05 and RMSE 12.10. That is the failure double robustness exists to catch.
Where both models were wrong, the estimator carrying the robustness label lost to the single model it was supposed to protect. At n=1,000, with both the propensity model and the outcome model misspecified, their weighted-least-squares doubly robust estimator had bias -2.99 and RMSE 3.33. Ordinary least squares, using nothing but the same misspecified outcome model, had bias -0.84 and RMSE 1.72. Same data. Same wrong model. A bias 3.6 times smaller.
So the label was correct throughout. It was also useless in exactly the situation a practitioner is least able to rule out. Double robustness is a promise about which of two nuisance models you are allowed to get wrong. It says nothing about a structure missing from both. It says nothing about a region where no comparable case exists.
- One half of the estimate is a prediction — what the outcome model says each case would have shown under each treatment, averaged across everyone.
- The other half is a correction built from what that prediction got wrong. Each miss is weighted by how likely the case was to receive the treatment it actually received.
- The promise on the tin: if either of those two models is right, and the causal assumptions hold, the estimate still lands on the truth. Weighting with a correct propensity model did exactly that, at bias -0.01 and RMSE 1.81.
- Orthogonality is why the two halves can rescue each other at all. A small error in a nuisance model moves the final score far less than it moves the model.
The correction exists to catch the prediction's mistakes
Take the outcome model on its own first. It predicts, for every case, what would have happened under treatment and under control. Average the difference and you have an estimate. That estimate is entirely at the mercy of one model. If the model is wrong about a kind of case, the answer is wrong by the same amount, and nothing in the arithmetic notices.
The augmentation is what notices. For each case you already know the outcome under the treatment it actually received. So you can subtract the prediction and keep the residual — the part the model failed to explain. Those residuals are then weighted by the probability of receiving that treatment. A case that was unlikely to be treated and was treated anyway stands in for the many similar cases that were not, so its residual counts for more. Add the weighted residuals back, and the estimator gets a second chance to be right.
That is the whole of double robustness. If the outcome model is right, the residuals are noise and the correction contributes nothing worth worrying about. If the outcome model is wrong but the treatment probabilities are right, the weights make the correction remove the bias the outcome model introduced.
Cross-fitting keeps this honest once the nuisance models are flexible, and the pairing has a source. Seven authors set both ingredients out together in 2018, under the name double/debiased machine learning: “We show that the impact of regularization bias and overfitting on estimation of the parameter of interest θ0 can be removed by using two simple, yet critical, ingredients: (1) using Neyman-orthogonal moments/scores that have reduced sensitivity with respect to nuisance parameters to estimate θ0, and (2) making use of cross-fitting which provides an efficient form of data-splitting.”
Their Figure 2 shows the second ingredient working. Fit the nuisance functions on the full sample and the estimator's finite-sample distribution sits visibly shifted off the true parameter. Run the identical procedure with two-fold cross-fitting and the distribution comes back centred, with roughly the same spread. The bias is removed at no cost in variance. The practical rule follows from the picture. The predictions used in a case's score come from models fitted on other folds, so a learner that has effectively memorised a case cannot use that memory when scoring it.
None of this reaches the design. In the both-wrong column the correction had nothing to correct with. A structure absent from both nuisance models is invisible to the augmentation exactly as it is invisible to the prediction. The same goes for a mismeasured variable, for cases whose outcomes affect each other, and for a stretch of the covariate space where one arm is empty.
One of the two nuisance models may be wrong. Which one is your choice; how many is not.
Example
The diagnostics, and what one of them is worth in numbers
Each of these takes minutes, and each answers a question the point estimate cannot. The last one has been priced. A 2012 study put four estimators — G-computation, IPTW, A-IPTW and TMLE — against 250 simulated datasets of size 1,000, built with near-positivity violations. Its description of the mechanism is the one every AIPW implementation carries: “As fewer individuals within a given covariate stratum receive a given treatment, the weights of those rare individuals who do receive the treatment become more extreme.”
- Check the outcome model separately inside each treatment arm, and check that the propensity model actually balances the covariates it was built to balance.
- Confirm that no case's score was built from nuisance predictions fitted on that same case. That is the only thing cross-fitting is there to buy you.
- Sort the per-case score contributions and read the top of the list. When a handful of cases carry the estimate, the estimate belongs to them rather than to the population.
- Look at where the estimated treatment probabilities crowd toward zero or one. That is where the residual correction is divided by almost nothing and detonates. In that 2012 study, with both the treatment and the outcome model correctly specified, unbounded A-IPTW had bias 0.080 but variance 0.966 and MSE 0.972. Bounding the estimated treatment probabilities to [0.025, 0.975] cut its variance to 0.017 and its MSE to 0.017 — roughly a 57-fold drop from a single bound. Plain IPTW moved the other way: bias 0.544 unbounded, then 1.080 at [0.025, 0.975], 1.437 at [0.05, 0.95] and 1.935 at [0.1, 0.9]. G-computation, which uses no weights at all, sat at bias 0.007, variance 0.009 and MSE 0.009 under every bound.
Visual
The estimate assembled, stage by stage
The diagram walks through the estimate in the order you build it. First the target is defined — which contrast, in which population, at which moment. Then the outcome models are fitted, one per arm. Then the propensity model, giving each case a probability of the treatment it received. Those two are combined into the orthogonal score, which is one number per case: the predicted contrast plus its weighted residual. Averaging the scores gives the estimate. Their spread gives the uncertainty around it.
The risks are not spread evenly across those stages. Almost everything that can go wrong causally was settled at the first stage, before any model was fitted. That is why a misspecification shared by both nuisance models survives every later stage untouched. Almost everything that goes wrong numerically becomes visible at the fourth, in the scores themselves. A handful of near-zero or near-one treatment probabilities show up there as a handful of enormous contributions.
- 1
Define target
Population and marginal treatment contrast.
- 2
Fit outcome models
Predict each treatment outcome from baseline covariates.
- 3
Fit propensity model
Estimate treatment assignment probability.
- 4
Form orthogonal score
Combine predictions with weighted residual correction.
- 5
Average and infer
Use cross-fitting and influence-based uncertainty.
Comparison
Let the estimates disagree in front of you
Three estimates can be assembled from the same two models, and they break in different directions. The outcome-regression estimate uses only the outcome model, so it inherits every mistake in it and none from the treatment side. The weighting estimate uses only the treatment probabilities. It stays calm where the outcome model is confused and turns violent where the probabilities approach zero or one. AIPW uses both, which is precisely why it can survive one of them being wrong.
The double/debiased machine learning paper printed the full grid rather than one number. Its worked example takes SIPP data, with 401(k) eligibility as the treatment and net financial assets as the outcome. It starts from the contrast with nothing held fixed: “the estimated ATE of 401(k) eligibility on net financial assets is $19,559 with an estimated standard error of 1413 when no control variables are used”.
Then it re-estimates. Orthogonal scores, medians taken over 100 sample partitions, propensity scores trimmed at 0.01 and 0.99, 5-fold cross-fitting. The interactive (AIPW-type) model gave $7,170 with lasso, $7,993 with a regression tree, $8,105 with a random forest, $7,713 with boosting, $7,788 with a neural net and $7,839 with the ensemble. The partially linear model, same data and same six learners, gave $8,187, $8,871, $9,247, $9,110, $9,038 and $9,166.
Read that grid in both directions and it tells you which choice mattered. Within either model the six learners barely disagree: $935 of spread in the interactive model, $1,060 in the partially linear one. Hold the learner fixed and switch the estimator, and the answer moves by $878 to $1,397. That is a shift comparable to or larger than the whole spread across the six learners. The decision doing the work was not the choice of machine learning. No single reported figure would have surrendered that.
So compute the components and print the grid. Agreement is evidence that neither nuisance model is single-handedly driving the answer. Disagreement tells you which component is doing the work.
Outcome regression
Relies on conditional outcome model.
- Efficient if accurate
- Counterfactual extrapolation
- No weight instability
IPW
Relies on treatment model.
- Marginal target
- Weight sensitivity
- Outcome model unnecessary
AIPW
Combines both models.
- Doubly robust
- Orthogonal score
- Still support-dependent
Steps
Build it so the components stay visible
Write down the contrast first, in a sentence, because everything that follows is machinery in service of it. Split the data into folds. On the complement of each fold, fit the outcome model separately within each arm and fit the propensity model, then predict into the held-out fold.
Form one score per case — the predicted contrast plus the weighted residual — and keep the scores rather than only their mean. The average is the estimate. The spread of the same scores gives the standard error, because those per-case values are the influence contributions.
That last step has a measured failure mode, and it lives in the interval rather than the estimate. A 2011 paper in the American Journal of Epidemiology ran 1,000 simulated cohorts at n=100, 500, 1,000 and 2,000, under three specification scenarios. The point estimates behaved: bias between -0.024 and 0.003 throughout. The intervals did not. At n=100 the model-based standard error, computed as if all models were correct, came out at 0.51. The empirical standard deviation was 0.69, a ratio of 0.74. The resulting 95% confidence intervals covered only 85.3% of the time (95% CI 83.0, 87.4). Intervals built from the bootstrap distribution instead covered 96.2% and 95.4% at the same sample size.
The authors are specific about when to expect it: “More concerning is the scenario in which the outcome regression models are correctly specified, whereas the PS model is not. In this situation, theory predicts that these standard errors would underestimate the true variability, leading to confidence intervals that are too narrow and less-than-nominal coverage.” Their worked example is the encouraging half of the same paper. At n=10,000, with a true effect that is null, a crude relative risk of 1.42 (95% CI 1.31, 1.53) is returned to the null by doubly robust estimation.
Then keep the pieces: the fold-level fits, the distribution of estimated treatment probabilities, the score attached to every case, and a bootstrap when the sample is small. An implementation that hands back a point estimate and nothing else has quietly discarded every diagnostic in the previous section.
- 1
Create folds
Split at the independent unit required by the design.
- 2
Fit nuisances
Train outcome and propensity learners outside each fold.
- 3
Generate scores
Compute counterfactual predictions and residual corrections.
- 4
Inspect components
Propensities, residuals, influence, and fold variation.
- 5
Compare estimates
Outcome regression, IPW, AIPW, and restricted targets.
Example
The words that get used interchangeably, and shouldn't
Three of these four are routinely treated as the same idea. Keep them apart when you read a write-up or review someone's code.
- AIPW stands for augmented inverse probability weighting, which is the weighted estimator plus the augmentation term that corrects it.
- Double robustness is the promise that one of the two nuisance models may be wrong, provided the causal assumptions underneath still hold. The phrase and the definition date from 2005, in Biometrics, in work by Bang and Robins on a cardiovascular clinical trial. Their abstract puts the benefit this way: “DR estimators, in contrast to standard likelihood-based or (nonaugmented) inverse probability-weighted estimators, give the analyst two chances, instead of only one, to make a valid inference.” Two chances, not a guarantee. And even that paper carries a published correction, in Biometrics in 2008.
- Orthogonality is the mathematical property that makes the promise possible, because the score barely reacts to small errors in the nuisance estimates. The double/debiased machine learning paper calls these Neyman-orthogonal moments/scores, with reduced sensitivity with respect to nuisance parameters.
- An influence function describes how hard a single case pushes on the estimate, which is where both the uncertainty and the instability come from.
Analogy
A route estimate corrected by the errors you actually made
A route planner reads a map and tells you how long the trip will take. It is wrong in ways that repeat: one junction always costs more than the map believes. Record how far off each estimate turned out to be, weight those recorded errors by how often you choose each route, and you can correct the prediction without ever fixing the map.
It works in the other direction too. A careful record of your errors rescues a crude map, and a good map survives a noisy record of errors. One accurate component carries the other. What the arrangement cannot survive is a map and a logbook that are wrong about the same junction in the same direction. That is the shape of the both-misspecified column in Kang and Schafer's tables.
What neither gives you is a road you have never driven. Nothing was recorded there, and the correction has no material to work with.
The estimator's version of that road is a stretch of the covariate space with no treated cases in it. The augmentation goes silent in exactly the same way.
A correction can only be built out of mistakes you were in a position to observe.
Prefer it when both models are credible, not when neither is
AIPW earns its place when both nuisance models can be estimated credibly, when overlap is real across the covariate space, and when there is genuine value in letting flexible learners do the predicting. Its influence-function form is a real bonus there. The same per-case scores that produce the estimate also produce its standard error, and the structure extends to harder targets.
It earns nothing when both models miss the same structure. The arithmetic of that case is Kang and Schafer's: bias -2.99 and RMSE 3.33 for the doubly robust estimator at n=1,000 with both models misspecified, against -0.84 and 1.72 for the single misspecified regression it was supposed to protect. Their abstract closes on it: “But it does demonstrate that, in at least some settings, two wrong models are not better than one.”
Overlap is checkable rather than atmospheric. A 2009 Biometrika paper derives the optimal subsample for precise estimation, and states the operational version plainly: “For a wide range of distributions a good approximation to the optimal rule is provided by the simple selection rule to drop all units with estimated propensity scores outside the range [0.1,0.9].” The earlier working-paper edition announced the cost in its title: moving the goalposts. Trimming does not rescue the estimate for the population you started with. It changes which population you are answering about, and that belongs in the write-up.
Flexibility is not free either. Learners that fit the training data well can be badly calibrated where it counts, and they tend to behave worst in the treatment tails. That is the same region where the weights are largest, so poor calibration and instability arrive together.
The working practice is therefore plural rather than singular. Estimate the components separately and compare them, as the 401(k) grid does across two estimators and six learners. Read the distribution of the per-case scores instead of only their mean. Refit with different learners and watch whether the answer travels. And keep the argument that the design identifies the effect at all — no unmeasured confounding, adequate overlap, a well-defined treatment — written out somewhere separate, where no estimator can be mistaken for having established it.
When the components disagree sharply, or when a few cases carry most of the influence, you have been told something. Treat it as the finding.
Picking the most reassuring of several disagreeing estimates is not a tie-break; it is the moment the disagreement stops being reported.
Key takeaways
- AIPW is two estimates in one — a prediction from an outcome model, corrected by the errors that model made, weighted by the probability of the treatment received.
- Double robustness gives the analyst, in Bang and Robins' phrase, two chances instead of one. When both chances are missed it can do worse than a single model: bias -2.99 against -0.84 for the misspecified regression alone at n=1,000.
- Orthogonality and cross-fitting are a pair, named together in 2018. Scores with reduced sensitivity to nuisance error, plus data-splitting — and Figure 2 shows the splitting removing the overfitting bias at no cost in variance.
- Where treatment probabilities crowd toward zero or one, the correction is divided by almost nothing. A-IPTW's variance fell from 0.966 to 0.017 once the estimated probabilities were bounded to [0.025, 0.975].
- Overlap has an operational rule — drop units with estimated propensity scores outside [0.1,0.9] — at the price of changing the estimand.
- Report the component estimators and the influence diagnostics beside the AIPW number. On the 401(k) data, switching estimator moved a given learner by $878 to $1,397, comparable to or larger than the whole spread across six learners. And at n=100 the model-based interval covered 85.3% instead of 95%.