Tutorials › Marginal Structural Models › Clever Covariates for Stochastic Interventions

Longitudinal Targeted Maximum Likelihood · Tutorial 382 of 501

Clever Covariates for Stochastic Interventions

Learn how stochastic intervention densities replace deterministic regime indicators in longitudinal clever covariates, and how the resulting ratios enter the targeting equations.

Advanced 13 min read

What You'll Learn

  • Define stochastic treatment interventions and the absolute-continuity condition needed for density ratios.
  • Derive cumulative clever covariates from the intervention and observed treatment laws.
  • Connect the ratios to longitudinal TMLE fluctuations and the efficient influence function.
  • Calculate weights for binary and continuous stochastic interventions.
  • Diagnose unstable or undefined ratios and distinguish stochastic from deterministic interventions.

From Regime Indicators to Intervention Density Ratios

A deterministic treatment regime asks what the outcome would be if treatment were set to a specified value at each decision. A stochastic intervention instead specifies a probability distribution for treatment, possibly depending on the history observed before that decision. In longitudinal targeted maximum likelihood estimation (TMLE), this change replaces the familiar regime-match indicator in the clever covariate with a likelihood ratio: the intervention treatment density divided by the observed treatment density.

The ratio is not just a convenient weight. It is the change of measure that makes histories generated under the observed treatment mechanism represent histories under the intervention. Its validity depends on support: the intervention must not assign positive probability to treatment values that the observed treatment law cannot produce.

Definition: At decision time \(t=1,\ldots,K\), let \(H_t\) denote the history available immediately before treatment \(A_t\). Write \(g_t(a\mid h)\) for the observed conditional treatment density or mass function, and \(q_t(a\mid h)\) for the intervention density or mass function. The intervention is absolutely continuous with respect to the observed treatment law if, for almost every relevant history \(h\), \(q_t(\cdot\mid h)\) assigns zero probability to every set to which \(g_t(\cdot\mid h)\) assigns zero probability. Where the ratio is defined, the time-\(t\) clever-covariate factor is \(q_t(A_t\mid H_t)/g_t(A_t\mid H_t)\); the cumulative factor through time \(t\) is \(W_t=\prod_{s=1}^{t}q_s(A_s\mid H_s)/g_s(A_s\mid H_s)\).

For a continuous treatment, “density” means density relative to a common dominating measure, usually Lebesgue measure. For a discrete treatment, it means probability mass. The ratio is evaluated at the treatment actually observed. Histories matter: even when the same treatment value is observed at two visits, its ratio can differ because the intervention and observed laws may depend on different histories.

Why the Ratio Is the Clever Covariate

To define the sequential regressions, let \(V_t(h_t)\) be the conditional mean of the outcome under the intervention from time \(t\) onward, given the history before treatment at time \(t\). Let \(Q_t(h_t,a_t)\) be the conditional expectation of the next intervention value given the current history and treatment. Specifically, for \(t<K\), \(Q_t(H_t,A_t)=E[V_{t+1}(H_{t+1})\mid H_t,A_t]\), where \(H_{t+1}\) includes the covariate history available before the next treatment. At the final visit, \(Q_K(H_K,A_K)=E[Y\mid H_K,A_K]\). Define

$$ V_t(h_t)=\int Q_t(h_t,a)\,q_t(da\mid h_t), \qquad \psi=E[V_1(H_1)]. $$

Here the integral also denotes a sum for discrete treatment. The observed-data law supplies the conditional covariate and outcome distributions in the \(Q_t\)'s; the intervention \(q_t\) supplies the treatment distributions in the \(V_t\)'s. Thus \(\psi\) is the mean outcome under the specified stochastic policy, under consistency and sequential exchangeability of treatment given the recorded histories. These causal assumptions give the intervention interpretation; the density-ratio calculations additionally require the support condition above.

Result: In a longitudinal TMLE fluctuation of \(Q_t\), the clever covariate is \(W_t\), the product of intervention-to-observed treatment density ratios through time \(t\). For a terminal outcome regression, this is \(W_K\). For example, a logistic fluctuation for a binary conditional mean has the form \(\operatorname{logit}Q_t^*=\operatorname{logit}Q_t+\epsilon_t W_t\). The corresponding score is proportional to \(W_t\) times the regression residual.

The reason is the change-of-measure identity below. It says that weighting an observed treatment draw by its intervention-to-observed ratio produces expectation under the intervention treatment law. In a longitudinal history, the identity applies successively, so the ratios multiply.

Proposition: If \(q_t(\cdot\mid h)\ll g_t(\cdot\mid h)\), then for every integrable function \(f\),
$$ E_g\left[\left.\frac{q_t(A_t\mid H_t)}{g_t(A_t\mid H_t)} f(A_t,H_t)\right|H_t\right] = \int f(a,H_t)\,q_t(da\mid H_t). $$

Proof. Conditional on \(H_t=h\), the observed treatment is distributed according to \(g_t(da\mid h)\). Therefore,

$$ \int \frac{dq_t}{dg_t}(a\mid h) f(a,h)\,g_t(da\mid h) = \int f(a,h)\,q_t(da\mid h). $$

For densities or mass functions, \(dq_t/dg_t\) is the stated ratio wherever \(g_t\) is positive. Applying this conditional identity at each decision gives the product \(W_t\); iterated expectation then replaces the observed treatment laws by the intervention laws through time \(t\). Integrability is required for these expectations to exist. \(\square\)

Worked Calculations

Worked Example: One Binary Stochastic Intervention

Suppose there is one treatment decision, \(A\in\{0,1\}\), and at a particular history \(H=h\), the observed probability of treatment is \(g(1\mid h)=0.40\). The intervention assigns treatment with probability \(q(1\mid h)=0.70\). Calculate the clever-covariate factor for each observed treatment value.

For \(A=1\), the observed-to-intervention comparison is \(q(1\mid h)/g(1\mid h)=0.70/0.40=1.75\). For \(A=0\), the probabilities are \(q(0\mid h)=0.30\) and \(g(0\mid h)=0.60\), so the ratio is \(0.30/0.60=0.50\).

The weighted probabilities under the observed law are \(0.40(1.75)=0.70\) for \(A=1\) and \(0.60(0.50)=0.30\) for \(A=0\). They reproduce the intervention distribution and sum to \(1\). In a logistic outcome fluctuation, the covariate is \(1.75\) for treated observations at this history and \(0.50\) for untreated observations.

Worked Example: Two Decisions With History-Specific Ratios

Let \(A_1,A_2\) be binary. At the first decision, suppose \(g_1(1)=0.40\) and \(q_1(1)=0.60\). At the second decision, specify probabilities separately for both histories: when \(A_1=1\), let \(g_2(1\mid H_2)=0.20\) and \(q_2(1\mid H_2)=0.50\); when \(A_1=0\), let \(g_2(1\mid H_2)=0.30\) and \(q_2(1\mid H_2)=0.40\). Calculate \(W_2\) for the trajectories \((A_1,A_2)=(1,0)\) and \((0,0)\).

For \((1,0)\), the first ratio is \(0.60/0.40=1.5\). At the history with \(A_1=1\), the second ratio for \(A_2=0\) is \((1-0.50)/(1-0.20)=0.50/0.80=0.625\). Hence \(W_2=1.5(0.625)=0.9375\).

For \((0,0)\), the first ratio is \(q_1(0)/g_1(0)=0.40/0.60=2/3\). At the different history with \(A_1=0\), the second ratio is \((1-0.40)/(1-0.30)=0.60/0.70=6/7\). Thus \(W_2=(2/3)(6/7)=4/7\), approximately \(0.5714\). The second ratio cannot be borrowed from the \(A_1=1\) history: it is defined by the treatment laws at the history actually reached.

Worked Example: A Continuous Stochastic Intervention

Suppose at a given history the observed treatment density is \(g(a\mid h)\), the density of \(N(0,1)\), and the intervention density \(q(a\mid h)\) is that of \(N(0.5,1)\). Both are positive on the real line, so the intervention is absolutely continuous with respect to the observed law. The ratio is

$$ \frac{q(a\mid h)}{g(a\mid h)} = \exp\left\{0.5a-\frac{0.5^2}{2}\right\} = \exp(0.5a-0.125). $$

At \(a=1\), the ratio is \(\exp(0.375)\), approximately \(1.455\). At \(a=-1\), it is \(\exp(-0.625)\), approximately \(0.535\). The ratio has observed-law expectation \(1\), as can also be checked directly:

$$ E_g\left[\exp(0.5A-0.125)\right] = \exp(-0.125)E_g[\exp(0.5A)] = \exp(-0.125)\exp(0.5^2/2) =1. $$

The intervention shifts the treatment distribution but remains continuous. It is not the deterministic instruction \(A=0.5\); that would be a point mass and would not have a density ratio with respect to \(N(0,1)\).

Derivation in the Targeting Equation

The ratio also appears directly in the efficient influence function. Under a nonparametric longitudinal model with the stated factorization, fixed \(q_t\), square-integrable influence-function terms, and the required absolute continuity, the efficient influence function for \(\psi\) is

$$ D(O)=V_1(H_1)-\psi+ \sum_{t=1}^{K} W_t\{V_{t+1}(H_{t+1})-Q_t(H_t,A_t)\}, $$

where the final summand uses \(V_{K+1}=Y\). This expression has conditional residuals, not treatment residuals: \(Q_t\) is the conditional mean of the next intervention value given the current history and treatment. Consequently, each summand has conditional mean zero given \((H_t,A_t)\) before multiplication by \(W_t\).

A derivation follows by perturbing the conditional outcome and covariate-transition distributions in the observed-data factorization. For a perturbation at time \(t\), the derivative of the target is the intervention-weighted derivative of the conditional mean \(Q_t\). The change-of-measure proposition replaces the intervention treatment law at each preceding decision by the corresponding factor \(q_s/g_s\); iterating yields \(W_t\). The centered conditional residual \(V_{t+1}-Q_t\) represents the derivative with respect to that conditional distribution. Perturbations of the observed treatment mechanisms contribute zero because the target uses the fixed intervention laws \(q_t\), not the observed \(g_t\)'s. Perturbations of the baseline distribution contribute \(V_1(H_1)-\psi\). Summing these score contributions gives the displayed expression. Its terms have mean zero, and their conditional centering makes them orthogonal to score components for treatment mechanisms. These properties identify the gradient in the nonparametric model. \(\square\)

In a fluctuation of \(Q_t\), the score is obtained by multiplying its conditional residual by \(W_t\). For a binary outcome, for example, the logistic fluctuation score is proportional to \(W_t\{Y-Q_t^*\}\) at the terminal step; earlier steps use the corresponding downstream pseudo-outcome in place of \(Y\). Setting the empirical score close to zero targets the residual term in the influence function. The recursion and the choice of fluctuation submodel are the same principles used in longitudinal TMLE; the stochastic intervention changes the treatment component of the clever covariate to the density ratio.

Assumptions, Diagnostics, and a Common Pitfall

The ratio construction has two distinct requirements. First, the causal interpretation of \(\psi\) requires consistency and sequential exchangeability: conditional on \(H_t\), treatment assignment must be unconfounded for the relevant future counterfactuals. Second, the intervention must satisfy absolute continuity with respect to the observed treatment law. For stable estimation, stronger practical overlap is often needed: ratios should not be so large that a few observations dominate the fit.

Useful diagnostics include inspecting the distribution of each time-specific ratio and of the cumulative \(W_t\), checking extreme values and effective sample sizes, and comparing these across visits and histories. A ratio that is undefined or extremely large can signal a support violation or near-violation, a poorly estimated treatment density, or a policy that places substantial weight in sparsely observed regions. Truncating ratios may reduce variance, but changes the estimating procedure and can introduce bias; it does not repair a structural absence of support.

  • Common mistake: treating every regime as a density-ratio intervention. For a discrete treatment and a deterministic regime \(A_t=d_t(H_t)\), the intervention mass is one at the assigned value and zero elsewhere. The ratio is therefore zero for a mismatch and \(1/g_t(d_t(H_t)\mid H_t)\) for a match, yielding the familiar indicator divided by the observed treatment probability.
  • Correction for continuous treatment: a deterministic assignment is a point mass, generally singular with respect to a continuous observed treatment distribution. It has no density ratio of the stated kind. The discrete reduction must not be carried over to continuous treatment.
  • Common mistake: using one history's denominator at another history. Every \(g_t(A_t\mid H_t)\) is evaluated at the observed current history. As the two-decision example shows, a different earlier treatment can lead to a different second-decision denominator.

Inverse-probability weighting uses the same ratios to reweight outcomes directly, while the g-computation formula averages sequential outcome regressions under \(q_t\). Longitudinal TMLE combines regression-based estimation with ratio-weighted targeting and a plug-in estimate. These approaches address the same intervention mean but have different finite-sample behavior; the clever covariate alone cannot overcome inadequate overlap or misspecified nuisance estimates.

Check Your Understanding

Work through each question, then compare with the solutions below.

  1. At a binary-treatment history, \(g(1\mid h)=0.25\) and \(q(1\mid h)=0.50\). What are the ratios for \(A=1\) and \(A=0\)?
  2. Why must the treatment ratios be multiplied across visits rather than replaced by a single ratio at the final visit?
  3. Can a deterministic intervention \(A=2\) for a continuously distributed treatment generally be represented by the density-ratio construction? Explain.
  4. What does a very large cumulative \(W_t\) suggest, and does truncating it eliminate a structural positivity violation?

Solutions. (1) For \(A=1\), \(0.50/0.25=2\). For \(A=0\), \(0.50/0.75=2/3\). The observed probabilities multiplied by these ratios are \(0.25(2)=0.50\) and \(0.75(2/3)=0.50\), as required. (2) Each ratio changes one conditional treatment law from \(g_t\) to \(q_t\); iterated change of measure across the sequence therefore gives the product. (3) Generally not: a point mass is singular relative to a continuous distribution, so the required intervention-to-observed density ratio does not exist. (4) It may indicate poor overlap, a support problem, or unstable nuisance-density estimates. Truncation can limit numerical influence but does not create observed support where none exists.

Clinical Biostats