What the Initial Terminal Regression Represents
In longitudinal targeted maximum likelihood estimation (TMLE), the terminal outcome regression is the starting estimate of the expected outcome given what has been observed before that outcome. Its job is specific: describe the conditional mean across the observed histories. It is not itself a causal effect, and fitting it does not yet impose a treatment regime or update the fit through targeting.
Use \(W\) for baseline covariates, \(L_t\) for covariates measured at time \(t\), \(A_t\) for treatment at time \(t\), and \(Y\) for the terminal outcome. With \(K\) treatment decisions, define the complete pre-outcome history as \(H_K=(W,L_1,A_1,\ldots,L_K,A_K)\), with entries ordered according to when they were measured. The observed terminal regression is the function \(Q_{K+1,0}(h)=E[Y\mid H_K=h]\). The subscript 0 indicates an initial, not yet targeted, regression; \(K+1\) labels the terminal outcome step in the backward sequence.
“Complete history” means all relevant recorded pre-outcome variables in the longitudinal data structure, not every conceivable predictor. If the outcome is subject to censoring, an unobserved \(Y\) is missing, not a zero. Which observations can contribute and how censoring is addressed depend on the data structure and analysis assumptions; do not silently code missing outcomes as observed values.
Specification and Fitting
First decide the outcome scale and the role of the history variables. For a binary \(Y\), a common working model is logistic:
Here \(f(H_K)\) is a selected set of history features: main effects, nonlinear terms, and interactions when scientifically justified. The fitted probability is the inverse-logit of the linear predictor, so it lies between zero and one. For a continuous \(Y\), one may use a linear conditional-mean model \(Q_{K+1,0}(H_K)=\beta_0+\beta^\top f(H_K)\), or another model whose mean and range suit the outcome. The fitting criterion should match the model and the outcome: for example, Bernoulli log likelihood for binary data and squared-error loss for an identity-link linear mean model.
The history must be represented in its temporal order. Omitting an earlier covariate or treatment may make the model too restrictive; including a variable measured after \(Y\) changes the conditioning set and can introduce information unavailable at the outcome time. The aim is not to include every possible interaction automatically. Instead, choose a defensible feature set based on subject-matter knowledge, sample size, and the need to represent important variation in the conditional mean.
Worked Example: Saturated Logistic Regression for a Binary Outcome
Suppose \(H\) and \(A\) are two binary components of the pre-outcome history, and \(Y\) is binary. Each of the four \((H,A)\) cells has 10 observations. The numbers with \(Y=1\) are 1, 3, 4, and 8 for cells \((0,0),(1,0),(0,1),(1,1)\), respectively. Fit a logistic model with an intercept, both main effects, and their interaction.
The observed cell proportions are \(0.1,0.3,0.4,0.8\). The saturated model is \(\operatorname{logit}P(Y=1\mid H,A)=\beta_0+\beta_HH+\beta_AA+\beta_{HA}HA\). For a saturated model, the fitted probability in each cell equals that cell’s sample proportion. The logit values, calculated from those proportions, are \(\operatorname{logit}(0.1)=-2.197225\), \(\operatorname{logit}(0.3)=-0.847298\), \(\operatorname{logit}(0.4)=-0.405465\), and \(\operatorname{logit}(0.8)=1.386294\).
At \((H,A)=(0,0)\), the linear predictor is \(\beta_0\), so \(\beta_0=-2.197225\). At \((1,0)\), it is \(\beta_0+\beta_H\), giving \(\beta_H=-0.847298-(-2.197225)=1.349927\). At \((0,1)\), it is \(\beta_0+\beta_A\), giving \(\beta_A=-0.405465-(-2.197225)=1.791760\). Finally, at \((1,1)\) the predictor is the sum of all four coefficients. Thus \(\beta_{HA}=1.386294-(-2.197225)-1.349927-1.791760=0.441833\), up to rounding.
The interaction is not a probability difference: it is the additional change in log odds beyond the two main effects. The fitted probability for the \((1,1)\) cell is \(\operatorname{expit}(-2.197225+1.349927+1.791760+0.441833)=\operatorname{expit}(1.386295)\), approximately \(0.8\), matching the observed cell proportion.
Why These Losses Estimate a Conditional Mean
The population target is a conditional expectation. The following results explain why common fitting criteria are aligned with that target when their models allow the relevant conditional mean or probability.
Proof. Write \(m=E[Y\mid H_K]\). For any eligible \(g(H_K)\), expand the square:
The last term is zero. Indeed, \(m-g\) is a function of \(H_K\), so the defining property of conditional expectation gives \(E[(Y-m)(m-g)]=E[E[Y-m\mid H_K](m-g)]=0\). Therefore,
Equality holds exactly when \(E[(m-g)^2]=0\), which means \(g=m\) almost surely. This establishes the minimization and uniqueness claim. \(\square\)
Proof. Conditional on \(H_K=h\), the expected negative log likelihood for a proposed probability \(q\) is \(r(q)=-p\log(q)-(1-p)\log(1-q)\). For \(0<p<1\) and \(0<q<1\), \(r'(q)=-p/q+(1-p)/(1-q)=(q-p)/\{q(1-q)\}\). The denominator is positive, so the derivative is negative for \(q<p\), zero at \(p\), and positive for \(q>p\). Thus the unique minimum is \(q=p\). If \(p=0\) or \(p=1\), the minimum over the closed interval \([0,1]\) is attained at the corresponding endpoint. Minimizing this conditional loss at almost every history minimizes its expectation, proving the claim. \(\square\)
These are population statements, not guarantees that a particular finite-sample model is correct. If the chosen model excludes the true conditional mean, its fitted values generally converge to a best approximation under the selected loss, rather than to the exact regression.
Worked Example: Fitting a Continuous Conditional Mean
Suppose a continuous terminal outcome is modeled using a numeric history feature \(X\), with \(Q_{K+1,0}(X)=\beta_0+\beta_1X\). The six observed outcomes are \((1,3)\) at \(X=0\), \((3,5)\) at \(X=1\), and \((5,7)\) at \(X=2\). Calculate the least-squares fit.
The sample means are \(\bar X=(0+0+1+1+2+2)/6=1\) and \(\bar Y=(1+3+3+5+5+7)/6=4\). The centered sum of squares for \(X\) is \(S_{XX}=2(0-1)^2+2(1-1)^2+2(2-1)^2=4\). The centered cross-product is \(S_{XY}=2(0-1)(2-4)+2(1-1)(4-4)+2(2-1)(6-4)=8\), where 2, 4, and 6 are the mean outcomes at the three \(X\) values.
Therefore \(\hat\beta_1=S_{XY}/S_{XX}=8/4=2\) and \(\hat\beta_0=\bar Y-\hat\beta_1\bar X=4-2(1)=2\). The fitted conditional means are 2, 4, and 6 at \(X=0,1,2\). The residuals within each pair are \(-1\) and \(1\), so they sum to zero within each feature value and overall. This verifies the fitted values and the least-squares normal equations. The fit describes the mean; it does not claim every individual outcome equals its fitted value.
Worked Example: Predicting from a Specified History
Suppose a logistic model for a binary terminal outcome uses the complete history through the final treatment decision. Its fitted linear predictor is \(\hat\eta=-1+0.5A+0.04X+0.02AX\), where \(A\) is the final binary treatment and \(X\) is a measured history variable centered at a clinically meaningful value. For a person with \(A=1\) and \(X=5\), compute the initial predicted outcome mean.
Substituting the history gives \(\hat\eta=-1+0.5(1)+0.04(5)+0.02(1)(5)=-1+0.5+0.2+0.1=-0.2\). The fitted probability is \(\hat Q_{K+1,0}=\operatorname{expit}(-0.2)=1/(1+e^{0.2})\approx0.4502\). For \(A=0\) at the same \(X\), the predictor is \(-1+0.04(5)=-0.8\), giving \(1/(1+e^{0.8})\approx0.3100\). These are fitted conditional means for two observed histories; their difference alone is not a regime-specific causal contrast.
Diagnostics, Alternatives, and Limitations
Assess whether the initial fit is credible on the histories where it will be used. For a binary outcome, inspect predicted probabilities for impossible values, extreme fitted values, sparse combinations of history variables, and systematic residual patterns. For continuous outcomes, inspect residuals against fitted values and important history features, and check for implausible predictions on the outcome scale. Calibration summaries can compare observed and predicted outcome frequencies across groups of predicted risk. These checks do not prove correctness, but patterns such as persistent underprediction in one history group signal that the model may be missing structure.
A saturated model can represent every cell mean for a finite categorical history, as in the first example, but it becomes impractical when the history has many variables: cells may be empty or contain too few observations. A parametric regression is more compact, but its adequacy depends on its functional form and interactions. Flexible regression or machine-learning methods can represent nonlinearities and interactions with less manual specification, but they still require adequate data, appropriate outcome handling, and careful assessment. No method can learn a well-supported conditional mean for histories with no or very little observed data.
The initial regression differs from an inverse-probability-weighted approach, which represents treatment or censoring processes through weights rather than beginning with this outcome regression. It also differs from the targeted update used later in longitudinal TMLE: the initial fit is an input to that procedure, not its final plug-in estimate. Correctly fitting \(Q_{K+1,0}\) is important, but by itself it does not address all identification assumptions, guarantee support for every history relevant to a regime, or establish causal interpretation.
Check Your Understanding
Answer each question, then compare with the solutions below.
- With two treatment decisions, what variables belong in the complete history for the terminal outcome regression?
- Why does squared-error loss target a conditional mean even when the continuous outcome is not normally distributed?
- For binary \(Y\), what is the fitted probability under a logistic model with linear predictor \(-0.4\), approximately?
- Name one diagnostic sign that a saturated model is too sparse to be reliable.
Solutions. (1) Include baseline covariates and all measured covariates and treatments up through the second decision, in temporal order, provided they precede the terminal outcome. (2) The squared-error decomposition in the proof shows that any other history-based prediction adds the nonnegative term \(E[(m-g)^2]\); normality is not required for that mean-minimization property. (3) The probability is \(\operatorname{expit}(-0.4)=1/(1+e^{0.4})\approx0.4013\). (4) Empty or very small history cells, unstable fitted cell proportions, or extreme predictions across sparse cells indicate inadequate data support for reliable saturated estimates.