This chapter specifies and partially illustrates the Causal Dynamical Model (CDM) pipeline through two extended biological case studies. Biology is the domain in which these examples are developed, not a limit on where CDMs apply. Each study spans organisational scales and shows how structure, dynamics, observation, inference, intervention, and counterfactuals fit one workflow. The Introduction and Chapter 28 host-immunity CDM remains the longitudinal spine; the cases below enlarge that vocabulary to gene regulation and epidemic contact structure. In each case, a form or attractor is a property of a declared model unless an independent causal role is specified and tested.
The pipeline we follow is:
Structure → Specify the causal graph encoding which variables influence which
Dynamics → Formulate the temporal evolution (ODEs, SDEs, or agent-based models)
Observation → Define how latent states manifest as noisy measurements
Inference → Learn parameters and infer latent trajectories from data
Intervention → Simulate the effect of external manipulations
Counterfactual → Reason about what would have happened under alternative scenarios
By working through concrete applications, we show how the CDM framework provides a unified methodology for causal reasoning across scales.
33.2 Scaffold: adaptive intervention in a bistable process
The benchmark demonstrator is a partially observed, regime-switching bistable biological process under time-varying treatment. Its scientific estimand is the probability that a declared intervention policy enters the degraded basin by horizon \(T\), together with a posterior unit-level trajectory under an explicitly declared cross-world coupling:
The reproducible data-generating process is now available in scripts/bistable_benchmark.jl. It supplies latent basin membership as simulation truth, a noisy record, a regime process and observational or declared treatment policies. The analysis suite provides naive recorded-group, context-adjusted recorded-outcome, record-level transition-proxy, fitted state-space proxy, longitudinal policy g-computation and known-mechanism CDM contrasts, together with a matched finite-grid comparison of model-predictive control (MPC) and an active-inference-style expected-free-energy policy. The controller comparison is a benchmark policy decomposition, not evidence for a universal free-energy principle: both policies use the same simulator, belief update and action set, while their objectives differ. Each analysis must declare its intervention, exchangeability and positivity assumptions, measurement design, coupling, numerical tolerances and scale map.
The controller table is deliberately narrower than a full active-inference implementation. The MPC policy scores one-step degraded-basin risk and treatment burden. The matched policy uses the same transition and observation model but scores risk, observation ambiguity and expected information gain in a finite belief grid. This makes the source of any difference inspectable; it does not identify a unique policy, establish universal FEP semantics, or replace a fitted partially observed state-space model.
The reduced analyses use recorded proxies and declared assumptions. The fitted state-space row filters the record before fitting a transition proxy; it is not a latent-state identification result. The longitudinal row is a sequential g-computation policy baseline and deliberately reports limited positivity under the threshold treatment policy. The targeted row runs CausalTargeted’s sequential LMTP/TMLE implementation on the same wide recorded panel; its positivity field is retained rather than suppressed when the observational policy supplies weak overlap. The particle-filter row performs nonlinear latent-state filtering and particle policy rollouts, but deliberately reports that parameter learning has been performed by a finite likelihood grid. The variational row uses a fast Gaussian assumed-density/Laplace filter with the declared parameters, providing an approximation check rather than a second identification strategy. The known-CDM row uses the simulator’s transition law and is therefore a reference contrast, not an observational estimate. Agreement with that row is an empirical result of the benchmark, not an assumption built into the reporting table. The certificate_fingerprint column is a semantic checksum over the declared model, observation process, intervention, estimand, identification assumptions, coupling and numerical settings.
For users who want message passing rather than the in-book assumed-density implementation, CausalDynamics.jl exposes the same benchmark structure through an optional RxInfer backend. infer_bistable_state_space places the cubic drift inside an explicit GraphPPL Delta factor and uses RxInfer’s local linearisation to propagate Gaussian state messages:
usingCausalDynamics, RxInferrx =infer_bistable_state_space( record, treatment, context, regime; Δt =0.08, iterations =20,)rx.state_means # posterior means for the latent trajectoryrx.state_variances # marginal variances from the same factor graph
This is a nonlinear variational filter, not an exact smoother and not a causal identification step. The transition and observation variances are declared inputs; policy or mechanism interventions must still be represented by the CDM and evaluated under its stated identification and coupling assumptions. For a reproducible state-RMSE and runtime comparison against the in-book Laplace filter, run julia --project=. --threads=4 scripts/rxinfer_bistable_comparison.jl. For repeated-seed benchmarking with the first-call compilation cost separated from steady-state inference, use julia --project=. --threads=4 scripts/rxinfer_bistable_repeated_benchmark.jl. In the current five-seed run, the warm-up took 15.0 seconds; subsequent RxInfer calls averaged 0.016 seconds and achieved mean RMSE 0.093 (SD 0.026), compared with mean RMSE 0.125 (SD 0.027) for the Laplace filter. These figures are hardware- and version-dependent diagnostics, not universal performance claims. Each benchmark prints Julia version, default/effective CPU-thread counts, BLAS threads, the active manifest and its SHA-256 digest. For comparable timing runs, set an explicit thread count (for example --threads=4) rather than relying on --threads=auto, whose Apple Silicon detection includes efficiency cores in Julia 1.13. The sensitivity grid additionally varies horizon, observation noise and iteration count, and reports nominal 95% coverage and interval width: julia --project=. --threads=auto scripts/rxinfer_bistable_sensitivity_benchmark.jl > rxinfer-sensitivity.csv. In the current grid all nominal intervals covered the simulated latent states; that 100% coverage is conservative evidence rather than calibration proof, so larger repeated simulations are still needed before tuning the variational family or its uncertainty scale.
33.3 Case Study 1: Gene Regulatory Network to Cell Fate
33.3.1 Biological Context
Gene regulatory networks (GRNs) control cell differentiation and fate decisions, and in parasite-responsive immune modules, Th2-associated transcription factors similarly gate cytokine and effector programmes. Transcription factors bind to enhancers and promoters, activating or repressing target genes in a coordinated cascade. Signalling pathways from the extracellular environment modulate these networks, creating a multi-scale system: molecular (genes, proteins) → cellular (differentiation state) → tissue (cell type composition).
Waddington’s epigenetic landscape provides a powerful dynamical systems metaphor: cells roll down a rugged landscape of valleys (attractors) representing stable cell fates, with ridges (separatrices) between them. Perturbations (such as transcription factor overexpression) can push cells from one valley to another, enabling reprogramming. The CDM framework formalises this intuition: the causal graph encodes regulatory structure, the dynamics define the landscape, and interventions correspond to pushing cells across ridges.
The key insight for causal modelling is that gene regulation is mechanistic: transcription factors bind to DNA, recruit polymerase, and modulate transcription rates. This mechanistic structure implies a causal ordering (upstream genes must be expressed before they can influence downstream targets) and supports the use of structural causal models for intervention and counterfactual reasoning.
33.3.2 Structural Stratum: The Causal Graph
At the molecular time scale, a GRN can be represented as a directed acyclic graph (DAG) when we consider discrete time steps and assume no instantaneous feedback within a single step. In practice, gene regulation involves feedback loops, but at coarse time resolution we can often approximate the structure as a DAG or use cyclic structural causal models (see Chapter 9b).
Consider a minimal 4-gene network: genes \(G_1\) and \(G_2\) are upstream regulators; \(G_3\) is activated by both; \(G_4\) is activated by \(G_3\) and repressed by \(G_2\). The causal graph encodes: \(G_1 \to G_3\), \(G_2 \to G_3\), \(G_2 \to G_4\), \(G_3 \to G_4\). Here \(G_2\) is a confounder of the \(G_3 \to G_4\) relationship (both cause \(G_3\) and \(G_4\)), and \(G_3\) is a mediator of the effect of \(G_1\) and \(G_2\) on \(G_4\).
The backdoor criterion identifies that conditioning on \(G_2\) blocks the backdoor path \(G_4 \leftarrow G_2 \to G_3\) when estimating the direct effect of \(G_3\) on \(G_4\). The frontdoor criterion applies when we have an unmeasured confounder: if \(G_1\) affects \(G_4\) only through \(G_3\), we can identify the effect via the frontdoor path \(G_1 \to G_3 \to G_4\).
The figure Figure 33.1 illustrates the minimal 4-gene network; the code chunk labelled chunk-grn-causal-graph builds the same graph in code. In state-space model diagrams, we use dashed outlines for latent variables (gene expression levels) and solid outlines for observed quantities. The graph structure is the foundation for all subsequent steps: it determines which interventions are well-defined, which causal effects are identifiable, and how to interpret the parameters of the dynamical model.
Figure 33.1: Minimal 4-gene regulatory network. \(G_1\) and \(G_2\) regulate \(G_3\); \(G_2\) and \(G_3\) regulate \(G_4\).
# Build GRN causal graph and identify confounders/mediators using CausalDynamics.jl# First run may take 1–2 min while CausalDynamics (and deps) load.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 CausalDynamics Graphs# Minimal 4-gene network: G1, G2 -> G3 -> G4, G2 -> G4g =SimpleDiGraph(4)add_edge!(g, 1, 3) # G1 -> G3add_edge!(g, 2, 3) # G2 -> G3add_edge!(g, 2, 4) # G2 -> G4add_edge!(g, 3, 4) # G3 -> G4gene_names = ["G1", "G2", "G3", "G4"]# Backdoor set for G3 -> G4: {G2} blocks G4 <- G2 -> G3# Frontdoor: G3 mediates G1 -> G4
4-element Vector{String}:
"G1"
"G2"
"G3"
"G4"
33.3.3 Dynamical Stratum: ODE Model
Gene regulation is typically modelled with Hill function kinetics, capturing the cooperative binding of transcription factors. When multiple transcription factors bind cooperatively to a promoter, the response is sigmoidal: low activator concentration yields minimal expression; high concentration yields maximal expression; the transition occurs over a narrow range determined by the dissociation constant \(K\) and cooperativity \(n\). For activation, the Hill function is \(H(x) = x^n / (K^n + x^n)\), where \(n\) is the cooperativity (Hill coefficient) and \(K\) is the half-saturation constant. For repression, \(H_{\text{rep}}(x) = 1 - H(x)\).
The state-space model has latent gene expression levels \(\mathbf{x}_t = (x_1, \ldots, x_4)\) evolving according to:
where \(\alpha_i\) is the maximal production rate, \(\delta_i\) is the degradation rate, \(\text{Pa}(i)\) denotes the parents of gene \(i\) in the causal graph, \(H\) is the appropriate Hill function of the parent expression levels, and \(w_i\) is process noise. For \(G_3\) with parents \(\{G_1, G_2\}\), we might use \(H(x_1, x_2) = H(x_1) \cdot H(x_2)\) (AND logic) or \(H(x_1) + H(x_2) - H(x_1)H(x_2)\) (OR logic).
The steady-state behaviour of such systems can exhibit bistability: two stable fixed points corresponding to distinct cell fates (e.g., differentiated vs. pluripotent). The separatrix between basins of attraction defines the “ridge” in Waddington’s landscape. Small perturbations near the ridge can tip the cell from one fate to another, the basis of reprogramming protocols. The ODE is implemented in the code chunk labelled chunk-grn-ode.
The state-space formulation treats \(\mathbf{x}_t\) as latent and the ODE as the transition model. With additive process noise \(w_t \sim \mathcal{N}(0, \sigma_w^2 \mathbf{I})\), we obtain a stochastic dynamical system suitable for filtering and smoothing.
33.3.4 Observable Stratum: Inference from Single-Cell RNA-Seq
Single-cell RNA-seq provides noisy, sparse snapshots of gene expression. Each cell is measured once (snapshot), and the data are counts, typically modelled as Poisson or negative binomial. The observation model is:
where \(\lambda_i\) is a cell-specific scaling factor (capturing sequencing depth) and \(\epsilon\) is a small constant for stability. The latent trajectory \(\mathbf{x}_t\) is inferred via filtering (forward pass) and smoothing (backward pass) in the state-space framework. Parameter learning proceeds via expectation-maximisation (EM): the E-step infers latent states given parameters; the M-step updates parameters given the inferred states. For nonlinear dynamics, the E-step may use extended Kalman filtering, unscented Kalman filtering, or particle filtering. The M-step updates \(\alpha\), \(\delta\), \(K\), \(n\) by maximising the expected complete-data log-likelihood.
A key challenge is pseudotime inference: single-cell data are cross-sectional (each cell measured once), so we do not observe true temporal trajectories. Instead, we infer a pseudotime ordering (a one-dimensional projection of cells along a developmental trajectory) from the expression data. Trajectory inference methods (e.g., Slingshot, Monocle) provide an approximate temporal ordering, which can then be used to fit the dynamical model. The CDM framework treats pseudotime as an estimated latent variable, with uncertainty propagated through the inference pipeline.
33.3.5 Interventions and Counterfactuals
A gene knockout corresponds to the intervention \(\mathrm{do}(x_i = 0)\): we set the expression of gene \(i\) to zero and propagate the effect through the dynamical system. In the ODE model, this means replacing the equation for \(\dot{x}_i\) with \(x_i \equiv 0\) and removing \(x_i\) from the parent functions of its children. The modified dynamical system is then simulated forward from the current state (or from equilibrium) to predict the post-intervention trajectory. This is the doing level of the causal hierarchy: we actively modify the system and observe the consequence.
Counterfactual reasoning answers: “What would have happened if gene \(X\) had been expressed at level \(x^*\)?” We use the three-step process: (1) abduction, infer a posterior over latent state and exogenous history consistent with the observed data; (2) action, replace the structural equation for \(X\) with \(X = x^*\); and (3) prediction, simulate forward under the declared coupling. This can inform cell reprogramming design: it identifies perturbations predicted by the model to alter the fate trajectory. It does not by itself establish that the posterior history is unique or that the intervention is feasible.
In the Yamanaka factors paradigm for induced pluripotency, four transcription factors (Oct4, Sox2, Klf4, c-Myc) are overexpressed to reprogram somatic cells to pluripotent stem cells. A counterfactual CDM could ask: “Given this cell’s observed trajectory toward differentiation, what would have happened if we had overexpressed Oct4 at day 2?” The answer informs optimal timing and dosing of reprogramming factors.
33.4 Case Study 2: Epidemiological Dynamics Across Scales
33.4.1 Biological Context
Infectious disease dynamics span multiple scales, whether the pathogen is a virus, helminth, or vector-borne agent in species A or B. Within-host: pathogen or parasite load builds, the immune system responds, and burden determines symptom severity and infectiousness. Between-host: contact patterns, transmission probability, and population structure determine prevalence curves. The two scales are coupled: within-host load influences between-host transmission probability; population-level interventions (vaccination, vector control) alter contact rates and susceptibility.
This multi-scale structure is common in complex dynamical systems. The CDM framework lets us represent causal structure at each scale, specify dynamics, and reason about cross-scale transportability (e.g. how a lab-measured effect translates to population-level impact).
The within-host and between-host scales operate at different time resolutions: viral load peaks within days; epidemics unfold over months. Coupling these scales requires modelling the mapping from within-host state (e.g., viral load) to between-host parameters (e.g., per-contact transmission probability). This mapping is often nonlinear and context-dependent.
33.4.2 Structural Stratum: Multi-Scale DAG
The within-host DAG encodes: pathogen or parasite load \(V\) → immune activation \(I\) → symptom onset \(S\). Load also directly influences symptom severity. The between-host DAG encodes: vaccination or vector-control coverage \(C\) → transmission events \(T\) → prevalence \(P\). A cross-scale edge connects within-host load to infectiousness: \(V \to T\), since higher burden typically increases transmission probability per contact.
This creates a hierarchical causal structure (Figure 33.2). Confounding can arise from unmeasured factors: e.g., host genetics affects both immune response and susceptibility to infection, creating a backdoor path. The backdoor criterion identifies that conditioning on host factors (when measured) or using instrumental variables (e.g., randomisation of vaccination) can identify causal effects.
# Multi-scale DAG: within-host and between-host with cross-scale edgesproject_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 CausalDynamics Graphs# Within-host: V -> I -> S, V -> S# Between-host: C -> T -> P# Cross-scale: V influences transmission (represented as V -> T)# Simplified combined graph with 6 nodes: V, I, S, C, T, Pg =SimpleDiGraph(6)add_edge!(g, 1, 2) # V -> Iadd_edge!(g, 1, 3) # V -> Sadd_edge!(g, 2, 3) # I -> Sadd_edge!(g, 4, 5) # C -> Tadd_edge!(g, 5, 6) # T -> Padd_edge!(g, 1, 5) # V -> T (cross-scale)
true
The multi-scale DAG is built in the code chunk labelled chunk-epidemic-causal-graph. Identification of the effect of vaccination on epidemic outcomes requires careful consideration of the graph. Vaccination affects susceptibility (blocks \(C \to T\) for vaccinated individuals) and possibly infectiousness (reduces \(V\), hence the cross-scale edge \(V \to T\)). The causal effect is identified when vaccination is randomised (no unmeasured confounders of vaccination status).
Within-host dynamics can be modelled with an SIR-like ODE for immune dynamics. The viral load \(V\) grows exponentially until the immune response \(I\) ramps up; then \(V\) declines as immune clearance dominates. Symptom severity \(S\) typically tracks viral load and inflammatory response:
\[
\dot{V} = r V - \gamma I V, \quad \dot{I} = \alpha V - \delta I, \quad \dot{S} = f(I, V)
\]
where \(V\) is viral load, \(I\) is immune activation, \(S\) is symptom severity, \(r\) is viral replication rate, \(\gamma\) is immune clearance, and \(f\) encodes the symptom response.
Between-host dynamics are naturally represented as an agent-based model (ABM) on a contact network. Each agent has a state (susceptible, infected, recovered) and position on the network. Transmission occurs along edges with probability depending on the infected agent’s viral load. Agents.jl provides the infrastructure for such models; a minimal ABM is shown in the code chunk labelled chunk-epidemic-abm.
The state-space representation of the epidemic curve treats the daily case count as a Poisson observation of the latent incidence, which is a function of the ABM state. The coupling is: within-host \(V\) determines per-contact transmission probability; the ABM simulates who gets infected; the epidemic curve aggregates over the population.
Surveillance data are noisy and incomplete. Case counts are Poisson (or negative binomial) observations of true incidence, with under-reporting. The reporting fraction \(\rho\) may vary over time (e.g., declining as healthcare systems become overwhelmed) and across regions, introducing additional complexity. Serological surveys provide imperfect estimates of seroprevalence (sensitivity and specificity \(< 1\)). Hospitalisation data are a delayed, filtered signal of severe cases.
State-space inference estimates the latent epidemic state (prevalence, incidence, \(R_t\)) from these observations. Parameter learning for the transmission rate \(\beta\) proceeds via particle filtering or MCMC. Time-varying \(R_t\) (the effective reproduction number) can be estimated by treating \(\beta_t\) as a latent process with smoothness priors, enabling detection of changes in transmission due to interventions or behaviour change.
where \(\lambda_t\) is the true incidence and \(\rho\) is the reporting fraction.
33.4.5 Interventions and Counterfactuals
Vaccination intervention: \(\mathrm{do}(\text{vaccination\_rate} = v)\) reduces susceptibility and/or infectiousness. In the ABM, we set a fraction of agents to “vaccinated” at \(t = 0\), modifying their transition probabilities.
Counterfactual: “What would the epidemic trajectory have been without the intervention?” We (1) infer a posterior over latent states, contact processes, and initial conditions from observed data; (2) remove the vaccination intervention; and (3) simulate forward under the declared cross-world coupling. This can quantify the impact of the vaccination campaign under the model and assumptions. Such comparisons answer “how many cases were prevented?” only to the extent that the observation, intervention, transport, and coupling assumptions are adequate; the difference is an estimated attributable effect, not a directly observed quantity.
Cross-scale transportability: Lab studies measure vaccine efficacy (reduction in viral load or infection probability in controlled settings). Transporting this to the population requires reasoning about the causal structure: lab conditions may differ from the field (different strains, age structure, contact patterns). The CDM framework provides the language for specifying transportability assumptions and identifying when population-level effects can be predicted from lab data.
Transportability analysis (Chapter 8) asks: under what conditions can we transfer the lab-measured effect to the population? If the only difference between lab and field is the distribution of contact patterns \(P(C)\), and the causal effect of vaccination on transmission is invariant across contexts, then the population effect is identified. If, however, vaccine efficacy depends on strain or species, and their distribution differs between lab and field, transportability fails without additional assumptions or data.
Both case studies illustrate common patterns. Structure constrains what can be learned and intervened upon; the causal graph is the first object we specify. Dynamics encode the temporal evolution; the choice of ODE vs. ABM depends on scale and granularity. Observation links latent states to data; Poisson and negative binomial models are natural for count data. Inference recovers parameters and latent trajectories; EM, particle filtering, and MCMC are the workhorses. Intervention and counterfactual reasoning answer policy-relevant questions: gene knockouts, vaccination campaigns, and what-if scenarios.
The CDM pipeline is a general methodology illustrated here in biology. It unifies structural causal modelling (Chapters 1–9), dynamical systems (Chapters 10–18), and observable inference (Chapters 19–27) into a single workflow.
Common patterns across case studies:
Latent structure: Both GRNs and epidemics have latent states (gene expression, viral load, true incidence) observed only through noisy measurements. State-space models provide the unifying framework.
Count data: RNA-seq counts and case counts both follow discrete distributions (Poisson, negative binomial). The observation model is a key component of the CDM.
Multi-scale coupling: GRNs couple molecular regulation to cellular fate; epidemics couple within-host dynamics to between-host transmission. The causal graph must explicitly represent cross-scale edges.
Intervention design: Both domains require answering “what if” questions, gene knockouts for reprogramming, vaccination for epidemic control. The do-calculus and counterfactual machinery are essential.
Open challenges include: scaling to high-dimensional GRNs (thousands of genes), handling unmeasured confounding in surveillance data (e.g., time-varying contact behaviour), and formalising cross-scale transportability when lab and field differ in unmeasured ways. As data quality and computational tools improve, the CDM framing remains a principled foundation for causal reasoning across scales.
The two case studies (gene regulation and epidemiology) represent distinct scales and modelling traditions, yet both fit naturally into the CDM framework. That transferability is the point: the same conceptual machinery (causal graphs, state-space models, do-calculus, counterfactuals) applies across domains. Analogous pipelines appear in neural circuits, ecological communities, engineered control systems, and metabolic networks, not only in the life sciences.
We have emphasised the pipeline rather than any single technique. No single method (whether causal discovery, parameter estimation, or counterfactual simulation) suffices alone. The power of the CDM framework lies in its integration: structure informs dynamics, dynamics inform observation, observation informs inference, and inference enables intervention and counterfactual reasoning. Each step builds on the previous, and the whole is greater than the sum of its parts.
The biological case studies in this chapter are illustrative rather than exhaustive. Similar pipelines apply wherever nested scales matter (neural circuits, ecological systems, socio-technical networks, metabolic pathways). The CDM framework is a general-purpose methodology; biology is one place we put it to work.
33.6 Case Study 3: MIRS mosquito age and transportability (AgeSCM)
33.6.1 Biological and operational context
Vector control programmes need reliable mosquito age to target infectious vs non-infectious fractions. Mid-infrared spectroscopy (MIRS) offers a non-destructive age proxy, but models trained in one country or study often fail when deployed elsewhere (Sikulu et al. 2014). AgeSCM implements the CDM pipeline for this problem: a structural graph over context, species, preparation, instrument, and spectra; a Flux encoder to a low-dimensional latent ẑ; and leave-one-country-out (LOSO) validation as the primary transport estimand (E1). The same graph-identification workflow used in observational cohort discovery (Ch. 05b) applies when candidate edges are proposed from domain knowledge before fitting transport weights.
33.6.2 Structural stratum
The SCM v0.3 DAG includes context C, species S, prep Z, instrument I, age A, latent physiology P, spectrum Y, and encoder ẑ. Identification drives a two-stage workflow: adjust nuisances on C, S, Z, I only; predict age from adjusted representations without using A in the adjustment fit.
33.6.3 Observable inference and packages
Layer
Tooling used here
Role
Structure
CausalDynamics, DAGMakie
DAG, backdoor sets
Spectra
Flux.jl
1D CNN / encoder ẑ
Transport
IPTW from P(C | nuisances)
Aligns with TMLE propensity (Ch 20)
Continuous pathway MTP (other cohorts)
CausalTargeted / CausalMediation
Small-\(n\) LMTP (Ch. 23) or mediation (Ch. 20); stack layout in Ch. 30
Target head
GraphPPL + RxInfer
VI on ẑ (installed; hierarchical head WIP)
High-dimensional wavenumbers do not enter the PPL directly, see Section 35.9 (Chapter 30).
33.6.4 Validation and findings
E1 (country LOSO, 73,521 spectra, full data):
Pipeline
Pooled MAE (days)
Notes
Mean spectrum OLS (T0)
23.76 / 23.73
Strongest unweighted baseline
Stage 1 + encoder ẑ_adj (T0)
24.47 / 24.17
Best deep+SCM unweighted
Stage 1 PCA + nuisances
24.62
Did not beat mean OLS (Phase 4)
Raw 1D CNN
24.83–26.1
Competitive on species S (~10 MAE)
Mean OLS + IPTW (T2)
22.87
Gate passed vs T0 mean OLS
Stage 1 + encoder + IPTW (T2)
23.81
Modest gain vs T0 encoder
Adjustment vs raw CNN: Environmental residualisation on C, S, Z, I did not improve pooled country transport vs a simple spectral mean. Overlap-aware IPTW (T2/T3) improved the mean-spectrum baseline by ~0.9 days; marginal IPTW (T1) and target reweight (T4) were unstable or domain-specific (low ESS on hold-out B under T4).
E2 (encoder audit): max |corr(ẑ, instrument)| up to ~0.47 on domain T (unweighted); reweighting does not remove batch structure uniformly, see AgeSCM docs/encoder-audit-results.md.
Calibration: pooled and per-domain reliability plots in AgeSCM Phase 4 (Section 25.7.3, Ch 21).
Reproduce: AgeSCM repository, scripts/phase3plus_tmle_transport.jl full, scripts/phase4_validation.jl full; case study docs/case-study-mirs-age.md.
Sikulu, Maggy T., Silas Majambere, Bakar O. Khatib, Abdullah S. Ali, Leon E. Hugo, and Floyd E. Dowell. 2014. “Using a Near-Infrared Spectrometer to Estimate the Age of Anopheles Mosquitoes Exposed to Pyrethroids.”PLOS ONE 9 (3): e90657. https://doi.org/10.1371/journal.pone.0090657.