Scientific claims often need to move across domains: cohorts, sites, years, or protocols (Bareinboim and Pearl 2013; Pearl and Bareinboim 2014). Transportability treats that move as a causal question: which mechanisms and edges are invariant, and which depend on domain?
In the organism–environment language of Chapter 9, transport is chiefly a change of environment (policies, measurement, cohort mix): does the same invariant graph \(G\) and mechanism class still hold? A two-site version of the host-immunity CDM asks whether \(B\) (treatment effect on the biomarker) and the assay map \(h\) travel across sites while assignment \(\gamma\) or confounder prevalence may shift (Chapter 28).
10.2 The transportability problem
Can a causal claim established in domain \(\mathcal{D}_1\) be used in \(\mathcal{D}_2\)? Typical domain axes include age, site, calendar time, and experimental protocol.
Some mechanisms are plausibly invariant (shared biology or physics); others vary (treatment assignment, measurement, population composition). The modelling task is to mark that difference explicitly rather than hoping invariance holds by default.
Critical realism supplies a useful caution. In an open system, an observed regularity may arise from several concurrent generative mechanisms whose relative operation changes with setting (Bhaskar 2008). Transportability asks which parts of a declared mechanism remain stable enough, under stated conditions, to support the target intervention claim.
10.3 Encoding domain shift
Introduce context variables \(\mathbf{C}\) for domain characteristics. Mechanisms may depend on \(\mathbf{C}\),
or omit \(\mathbf{C}\) when the assignment is claimed invariant. Edges from \(\mathbf{C}\) into \(A\) or \(Y\) in a selection / context diagram encode which parts of the data-generating process shift (Pearl and Bareinboim 2014).
project_root =let current =pwd()while !isfile(joinpath(current, "Project.toml")) && !isfile(joinpath(current, "_quarto.yml")) parent =dirname(current) parent == current &&break current = parentend currentendinclude(joinpath(project_root, "scripts", "ensure_packages.jl"))@auto_using DAGMakie CairoMakie Graphs CausalDynamics StableRNGs# Context C confounds treatment A and outcome Y across domainsg_ctx, ctx_labels =confounding_graph(["C", "A", "Y"])println("Context diagram edges (C → A, A → Y, C → Y):")foreinedges(g_ctx)println(" ", ctx_labels[src(e)], " → ", ctx_labels[dst(e)])endid =identify(g_ctx, TotalEffectQuery(2, 3); node_names = [:C, :A, :Y])println("identify A→Y with C present: strategy=$(id.strategy), adjustment=$(id.adjustment)")
Context diagram edges (C → A, A → Y, C → Y):
C → A
C → Y
A → Y
identify A→Y with C present: strategy=backdoor, adjustment=[:C]
Figure 10.1: Context \(C\) as a good control / common cause of treatment \(A\) and outcome \(Y\): a minimal domain-shift diagram (Cinelli et al. 2024).
10.4 Criteria and practice
Given a graph with context / selection nodes:
Put \(\mathbf{C}\) (or selection indicators) in the diagram explicitly.
Ask which edges out of \(\mathbf{C}\) are present (assignment shift, effect modification, both).
Apply transportability theorems when the diagram matches a known pattern (Bareinboim and Pearl 2013), or adjust / reweight when \(\mathbf{C}\) is observed.
Check sensitivity: how wrong is the claim if an assumed invariant edge is not?
Prefer external validation in the target domain when feasible.
10.4.1 Hidden confounding and robust prediction
Gnecco et al. (Gnecco et al. 2026) sharpen the distinction between a causal mechanism and a predictor that remains useful after a distribution shift. Their simultaneous-equation model allows the observed covariates \(X\) to be endogenous and uses an exogenous shift variable \(Z\) to construct a control variable \(V = X - MZ\). The boosted control function adds the part of the estimated control-function contribution that depends only on the invariant coordinates \(R^\top X\), where the columns of \(R\) span the left null space of \(M\). Under the paper’s assumptions this target is identifiable and worst-case optimal over the specified class of shifts, even when the nonlinear structural function itself is not identifiable.
The following small linear implementation exposes that construction. It is a reference implementation for the book, not a substitute for the paper’s nonparametric ControlTwicing estimators.
BCF training RMSE: 0.598
Invariant-coordinate dimension: 1
The guarantee is conditional, not magical: \(Z\) must represent a credible exogenous source of shift, the support and rank conditions must be defensible, and a stable predictive target is not automatically an identified interventional effect.
10.5 Testing effect modification across domains
A minimal statistical check for mechanism shift is an interaction of treatment with domain. Synthetic data with different treatment effects by cohort:
@auto_usingRandom Distributions GLM DataFrames StableRNGsrng =StableRNG(42)n_per =200A_d1 =rand(rng, Distributions.Bernoulli(0.3), n_per)Y_d1 =0.5.* A_d1 .+rand(rng, Distributions.Normal(0, 0.2), n_per)A_d2 =rand(rng, Distributions.Bernoulli(0.7), n_per)Y_d2 =0.3.* A_d2 .+rand(rng, Distributions.Normal(0, 0.2), n_per)df =DataFrame( C = [zeros(n_per); ones(n_per)], A =Float64[A_d1; A_d2], Y = [Y_d1; Y_d2],)model =lm(@formula(Y ~ A + C + A * C), df)β =coef(model)δ =length(β) >=4 ? β[4] :0.0println("Estimated A effect at C=0: ", round(β[2]; digits =3))println("Estimated A effect at C=1: ", round(β[2] + δ; digits =3))println("Interaction A×C: ", round(δ; digits =3))println(abs(δ) >0.1 ?"Mechanisms differ by domain → transport needs C (or domain-specific effects).":"No large interaction in this draw → invariance more plausible (still not proof).")
Estimated A effect at C=0: 0.523
Estimated A effect at C=1: 0.319
Interaction A×C: -0.203
Mechanisms differ by domain → transport needs C (or domain-specific effects).
NoteAge-dependent mechanisms
If \(Y \coloneqq f(A, C, U)\) with \(C\) = age band, transporting an effect estimated in one band to another requires either invariance (no \(C\) in \(f\)) or an explicit adjustment / stratified effect. Assuming invariance without a diagram or check is the usual failure mode.
10.6 Dataset shift as a causal problem
Standard ML “dataset shift” labels map onto causal distinctions:
Framing the shift with \(\mathbf{C}\) and edges clarifies what reweighting or retraining can achieve.
10.7 Worked example: AgeSCM country hold-out
The AgeSCM application (Case Study 3, Chapter 28b) treats generalisation of MIRS mosquito-age models as transport of predictive performance across context C (country). The primary metric is leave-one-country-out (LOSO) MAE.
Weight scheme
Model
Pooled MAE (days)
Interpretation
T0
Mean spectrum OLS
23.73
Unweighted transport baseline
T0
Stage 1 + encoder
24.17
Best unweighted deep+SCM pipeline
T2
Mean spectrum OLS
22.87
IPTW using \(P(C \mid\) nuisances\()\)
T2
Stage 1 + encoder
23.81
Weighted SCM; small gain over T0 encoder
T1
Mean spectrum OLS
29.57
Marginal IPTW harmful (poor overlap)
Reweighting toward the test-domain mix helps the simplest spectral baseline when propensity is modelled on measured nuisances; it does not uniformly rescue CNN pipelines. Structural invariance of the age→spectrum mechanism remains an open audit alongside predictive transport.
10.8 Stratum context
Transportability sits on a Structural → Observable bridge: invariant mechanisms are structural claims; whether they hold in new data is an observable question. It prepares the move from Part I toward time and measurement in later parts without assuming every cohort shares the same generating process.
10.9 Summary
Cross-domain claims need diagrams that mark what \(\mathbf{C}\) changes. Invariant mechanisms travel; domain-dependent assignment or effect edges need adjustment, stratification, or honest restriction of the target population. Statistical interactions and hold-out metrics (as in AgeSCM) are checks, not substitutes for the causal diagram.
10.10 Further Reading
Bareinboim and Pearl (2013): deciding transportability
Bareinboim, Elias, and Judea Pearl. 2013. “A General Algorithm for Deciding Transportability of Experimental Results.”Journal of Causal Inference 1 (1): 107–34.
Bhaskar, Roy. 2008. A Realist Theory of Science. 2nd ed. Routledge.
Cinelli, Carlos, Andrew Forney, and Judea Pearl. 2024. “A Crash Course in Good and Bad Controls.”Sociological Methods & Research 53 (3): 1071–104. https://doi.org/10.1177/00491241221099552.
Dahabreh, Issa J., Sarah E. Robertson, Jon A. Steingrimsson, Elizabeth A. Stuart, and Miguel A. Hernán. 2019. “Extending Inferences from a Randomized Trial to a New Target Population.”Statistics in Medicine 39 (14): 1999–2014.
Gnecco, Nicola, Jonas Peters, Sebastian Engelke, and Niklas Pfister. 2026. “Boosted Control Functions: Distribution Generalization and Invariance in Confounded Models.”Journal of Machine Learning Research 27 (46): 1–57. https://jmlr.org/papers/v27/24-2207.html.
Pearl, Judea, and Elias Bareinboim. 2014. “External Validity: From Do-Calculus to Transportability Across Populations.”Statistical Science 29 (4): 579–95.