Tutorials › Propensity Score Matching and Instrumental Variables › Super Learner Nuisance Fits for TMLE

Doubly Robust Estimation · Tutorial 319 of 699

Super Learner Nuisance Fits for TMLE

Learn to construct Super Learner nuisance predictions for TMLE and pass them into the targeting step without confusing model flexibility with causal identification.

Advanced 13 min read

What You'll Learn

  • Define the outcome regression and propensity score nuisance functions used by the ATE TMLE.
  • Combine candidate nuisance-model predictions with cross-validated Super Learner weights.
  • Choose loss functions that match binary, bounded, or continuous outcomes.
  • Translate fitted outcome and propensity predictions into the inputs for a logistic fluctuation.
  • Diagnose poor overlap, unstable predictions, and limitations of an ensemble.

Why Use Super Learner Before TMLE?

TMLE requires initial estimates of two nuisance functions: the conditional outcome mean and the treatment mechanism. A simple parametric model can be useful, but its predictions may be poor if its functional form is inappropriate. Super Learner offers a systematic way to combine predictions from a prespecified library of candidate models using cross-validated predictive performance. The resulting estimates are then supplied to TMLE's targeting step.

The distinction between prediction and identification is important. Super Learner can make nuisance estimates more adaptive, but it does not establish that treatment assignment is unconfounded, create covariate overlap, or repair an ill-defined treatment. For a causal interpretation of the average treatment effect, the causal assumptions must still be credible.

Definition: Let \(O=(W,A,Y)\) denote an observation, with baseline covariates \(W\), binary treatment \(A\in\{0,1\}\), and outcome \(Y\). The outcome regression is \(Q_0(a,w)=E(Y\mid A=a,W=w)\), and the propensity score is \(g_0(w)=P(A=1\mid W=w)\). Super Learner forms an ensemble of candidate predictions for one or both functions, with weights chosen to minimize estimated out-of-sample prediction loss over a candidate library.

For the ATE, the target is \(\psi_0=E\{Q_0(1,W)-Q_0(0,W)\}\). Its causal interpretation relies, among other conditions, on consistency, conditional exchangeability \(Y(a)\mathrel{\perp} A\mid W\) for \(a=0,1\), and positivity \(0<P(A=1\mid W)<1\) on the covariate support relevant to the target population. These assumptions concern the data-generating process; they are not consequences of fitting an ensemble.

A library might include a main-effects generalized linear model, models with prespecified interactions or nonlinear terms, and flexible learners such as penalized regression, trees, or splines. The library should be specified before inspecting which candidate performs best, and its members should be plausible for the data size and scientific setting. An ensemble cannot reliably select a model that was not included, and an excessively large or poorly tuned library can still predict badly.

How the Ensemble Is Constructed

For the outcome regression, each candidate estimates \(Q_0(a,w)\), usually by modelling \(Y\) as a function of both \(A\) and \(W\). For the propensity score, each candidate estimates \(g_0(w)\) from \(A\) and \(W\). Cross-validation produces predictions for observations not used to train the corresponding candidate fit. A loss is then computed from those held-out predictions.

For candidate predictions \(f_1,\ldots,f_K\), Super Learner commonly chooses weights \(w_k\) by minimizing the cross-validated loss of their weighted prediction, subject to \(w_k\geq 0\) and \(\sum_{k=1}^K w_k=1\). Outcome and propensity libraries are generally fitted separately, with losses appropriate to their different outcomes. Typical choices include squared-error loss for a continuous outcome, Bernoulli negative log-likelihood or another proper binary loss for a binary outcome, and Bernoulli log loss for the treatment mechanism. For bounded outcomes, the candidate and loss choices should respect the outcome scale; an appropriate link can keep predictions within the bounds.

This cross-validation is used to compare and combine nuisance learners. It is not, by itself, cross-validated TMLE: in ordinary TMLE, the fitted nuisance predictions are assembled for the targeting and plug-in steps on the analysis sample. The later cross-validated TMLE construction handles targeting and estimation across folds differently.

Worked Example: Combining Outcome Predictions

Suppose two candidate outcome learners are evaluated using held-out data, and the cross-validated loss minimization assigns weights \(0.60\) to learner 1 and \(0.40\) to learner 2. At a particular covariate profile \(w\), their predicted risks under treatment are \(0.50\) and \(0.65\), respectively. The ensemble prediction is

$$ \widehat Q(1,w)=0.60(0.50)+0.40(0.65)=0.30+0.26=0.56. $$

If their predictions under control are \(0.30\) and \(0.40\), then

$$ \widehat Q(0,w)=0.60(0.30)+0.40(0.40)=0.18+0.16=0.34. $$

The initial predicted treatment contrast for this covariate profile is \(0.56-0.34=0.22\), or 22 percentage points for a binary outcome. This is not yet the population ATE estimate: the ATE plug-in estimate averages the updated individual-level contrasts over the analysis sample. Also, the weights are learned from predictive loss across held-out observations, not chosen to make this one person's contrast large or small.

Because the weights are nonnegative and sum to one, a weighted average of candidate predictions lying in \([0,1]\) also lies in \([0,1]\). This is useful for probabilities, but it does not guarantee that the predictions are well calibrated, that the propensity scores are bounded away from zero and one, or that the candidate library captures the relevant structure.

Passing the Fits to the Targeting Step

After fitting the nuisance ensembles, evaluate the outcome model at both treatment levels for every individual: \(\widehat Q(1,W_i)\) and \(\widehat Q(0,W_i)\). Separately, evaluate the propensity ensemble at each \(W_i\) to obtain \(\widehat g(W_i)\). These predictions define the initial regression and the clever covariates used by the fluctuation.

For a binary outcome, a common fluctuation uses a logistic link and the ATE clever covariate \(H(A,W)=A/g(W)-(1-A)/\{1-g(W)\}\). With the estimated propensity score, the observed-data clever covariate is \(H_i=A_i/\widehat g(W_i)-(1-A_i)/\{1-\widehat g(W_i)\}\). For counterfactual prediction at treatment level \(a\), the corresponding covariate is \(H(a,W)=a/g(W)-(1-a)/\{1-g(W)\}\). Thus, the treated and control logit updates are \(\widehat\epsilon/g(W)\) and \(-\widehat\epsilon/\{1-g(W)\}\), respectively, so their directions depend on the sign of \(\widehat\epsilon\).

In a logistic fluctuation with initial outcome predictions \(\widehat Q(A_i,W_i)\), the updated prediction has the form

$$ \operatorname{logit}\widehat Q^{*}(A_i,W_i) = \operatorname{logit}\widehat Q(A_i,W_i)+\epsilon H_i. $$

The fluctuation parameter \(\epsilon\) is estimated by fitting the specified logistic fluctuation, using the initial prediction as an offset and the clever covariate as the fluctuation covariate. One then uses the fitted \(\widehat\epsilon\) and counterfactual clever covariates to obtain \(\widehat Q^{*}(1,W_i)\) and \(\widehat Q^{*}(0,W_i)\). The ATE TMLE is the average of these updated contrasts.

Derivation: In the logistic fluctuation, the fitted mean for observation \(i\) is \(Q_{\epsilon,i}=\operatorname{expit}\{\operatorname{logit}\widehat Q(A_i,W_i)+\epsilon H_i\}\). The Bernoulli log-likelihood, up to terms not depending on \(\epsilon\), is \(\sum_i[Y_i\log Q_{\epsilon,i}+(1-Y_i)\log(1-Q_{\epsilon,i})]\). Differentiating with respect to \(\epsilon\) gives the score \(\sum_i H_i(Y_i-Q_{\epsilon,i})\). The maximum-likelihood estimate therefore solves the fluctuation score equation \(\sum_i H_i\{Y_i-\widehat Q^{*}(A_i,W_i)\}=0\), when a finite solution exists. This explains why the propensity predictions enter the targeting step through \(H_i\), while the outcome predictions enter as the offset.

Worked Example: Translating Predictions Into a Logistic Update

Consider a hypothetical individual with \(A=1\), \(\widehat g(W)=0.40\), and initial outcome prediction \(\widehat Q(1,W)=0.565\). Suppose the fitted fluctuation coefficient for the dataset is \(\widehat\epsilon=0.08\). The observed clever covariate is

$$ H=\frac{1}{0.40}=2.5. $$

The initial prediction's logit is

$$ \operatorname{logit}(0.565)=\log\left(\frac{0.565}{0.435}\right)\approx 0.2615. $$

The updated treated prediction is therefore

$$ \widehat Q^{*}(1,W)=\operatorname{expit}\{0.2615+0.08(2.5)\} =\operatorname{expit}(0.4615)\approx 0.6134. $$

For comparison, if the initial control prediction at the same \(W\) is also \(0.565\), its counterfactual clever covariate is \(-1/(1-0.40)=-1.6667\). The updated control prediction is

$$ \widehat Q^{*}(0,W)=\operatorname{expit}\{0.2615+0.08(-1.6667)\} =\operatorname{expit}(0.1282)\approx 0.5320. $$

The positive and negative signs follow from the ATE clever covariate. The assumed value \(0.08\) is illustrative of a fitted coefficient; in an analysis, it must be estimated from the full fluctuation fit rather than selected to obtain a desired contrast.

Propensity Predictions, Diagnostics, and Failure Modes

A propensity ensemble is used to estimate treatment probabilities, not to predict the outcome. Its values enter inverse-probability factors in the clever covariate, so predictions near zero or one can create large values even when the outcome fit looks reasonable. Inspect the distribution of \(\widehat g(W_i)\), the range of the clever covariates, and whether very large weights are concentrated in a small number of observations. Also check that both treatment groups are represented across important covariate profiles.

Worked Example: A Propensity Ensemble and Its Clever Covariate

Suppose three propensity learners give predictions \(0.25\), \(0.45\), and \(0.65\) at a covariate profile, and cross-validated weights are \(0.20\), \(0.50\), and \(0.30\). The ensemble propensity prediction is

$$ \widehat g(W)=0.20(0.25)+0.50(0.45)+0.30(0.65) =0.05+0.225+0.195=0.47. $$

For a treated individual at this profile, \(H=1/0.47\approx2.128\). For a control individual, \(H=-1/(1-0.47)=-1/0.53\approx-1.887\). These values are not extreme by themselves. If, instead, \(\widehat g(W)=0.02\), a treated individual's clever covariate would be \(1/0.02=50\), signaling potential instability. The ensemble weight constraint keeps the prediction between the candidate probabilities in this example; it does not ensure overlap in the population.

Practical diagnostics should include predictive performance on held-out folds, the distribution and calibration of predicted probabilities, overlap by treatment group, and sensitivity of results to reasonable library or truncation choices. Truncating estimated propensities can limit extreme clever covariates, but it changes the nuisance estimates and does not make a genuine lack of positivity disappear. Report the truncation rule if used and assess whether conclusions depend strongly on it.

A common mistake is to assume that because Super Learner combines many algorithms, it automatically protects TMLE from misspecification or confounding. It does not. The ensemble optimizes an estimated prediction criterion within the chosen library; if every candidate misses an important feature, the ensemble may miss it too. More fundamentally, a highly accurate propensity prediction cannot establish conditional exchangeability, and accurate nuisance prediction cannot compensate for absent treatment overlap.

How Super Learner Fits Compare With Alternatives

ApproachHow nuisance predictions are chosenMain consideration for TMLE
Single parametric modelSpecify one functional form and estimate its parametersTransparent and potentially stable, but sensitive to a poor functional form
Separate flexible learnerUse one selected algorithm for each nuisance functionCan capture complex patterns, but performance depends on the selected learner and tuning
Super LearnerCombine candidate predictions using cross-validated lossReduces reliance on one candidate, but remains limited by the library, data, and overlap

Super Learner is most useful when several credible learners may describe the nuisance functions differently and there is enough data to compare their predictions. A small sample, rare treatment, or sparse outcome events can make cross-validated losses and ensemble weights unstable. In those settings, a simpler, scientifically justified library may be preferable to adding many highly adaptive candidates. The ensemble also does not choose the causal estimand, validate the identifying assumptions, or provide a substitute for inference appropriate to the estimator.

Key takeaway: Fit outcome and propensity ensembles with suitable losses, preserve their distinct roles, and pass \(\widehat Q(A_i,W_i)\) as the targeting offset and \(\widehat g(W_i)\) into the clever covariate. Then evaluate both updated counterfactual outcome predictions to form the TMLE plug-in estimate.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. What does cross-validation select in a Super Learner nuisance fit, and what does it not establish about causal identification?
  2. A binary-outcome ensemble uses weights \(0.25\) and \(0.75\) on candidate predictions \(0.40\) and \(0.60\). What is the ensemble prediction?
  3. For \(\widehat g(W)=0.20\), calculate the ATE clever covariate for a treated and a control individual.
  4. Why is an ensemble propensity prediction of \(0.01\) a warning even if the ensemble's predictive loss is low?
  5. In a logistic fluctuation, which nuisance prediction serves as the offset, and which determines the clever covariate?

Solutions. (1) Cross-validation estimates candidate predictive loss and supports selection of ensemble weights within the chosen library. It does not establish consistency, conditional exchangeability, or positivity. (2) The ensemble prediction is \(0.25(0.40)+0.75(0.60)=0.10+0.45=0.55\). (3) For treatment, \(H=1/0.20=5\). For control, \(H=-1/(1-0.20)=-1.25\). (4) For a treated individual, \(1/\widehat g(W)=100\), so the clever covariate may be very large and the targeting update unstable; low average prediction loss does not rule out poor overlap. (5) The initial outcome prediction \(\widehat Q(A_i,W_i)\) is the offset, while the propensity prediction \(\widehat g(W_i)\) determines \(H_i\).

Clinical Biostats