Scope and architecture

CausalDynamics.jl implements Pearl-style identification and executable structural models for Causal Dynamical Models (CDMs), including time-indexed simulation, do(·), and shared-U counterfactual trajectories.

The CDCS book uses these exported APIs in narrative chapters. Identification and estimation names stay Pearl/SciML. Temporal identity may use the closed lexicon in Terminology (temporal_support, value_representation, referent_id, graph_kind, relation_kind, onset, replacement, deployment). Whitehead glossary terms live in the book (Concept Reference).

What is in core (v0.1–v0.2)

LayerRoleTypical API
GraphsDAG validation, ancestral sets, pathsis_dag, get_ancestors, find_backdoor_paths
IdentificationCriteria for adjustment / instrumentsd_separated, backdoor_adjustment_set, frontdoor, IV
Static SCMOne-shot settlement given UGraphSCM, DoIntervention, simulate_scm, compute_counterfactual
Discrete-time CDMTrajectories over occasionsDiscreteTimeCDM, DoSequence, simulate, counterfactual
Observational panelsWide tables for sequential estimationCDMPanel, simulate_panel, panel_column_name
Hierarchical nestingCluster→unit exogenous draws; plate unroll for IDRandomEffectSpec, simulate_hierarchical_panel, unroll_hierarchical_dag, attach_hierarchy_assumptions
Relational groundingEntity/relation schemas grounded to ordinary causal graphsRelationalSchema, RelationalSkeleton, RelationalParent, ground_relational_graph
Latent → observed bridgeFilter/smoother outputs → panel columnsObservationBridge, panel_from_latent_series, simulate_observed_panel
Representation bridgeHigh-dim tensor → low-dim codes for ID/estimationRepresentationSpec, encode_to_panel, representation_certificate
Structural constraintsAuditable declared invariance, feasibility, viability, or cross-embodiment claimStructuralConstraintSpec, constraint_certificate
Deep mechanismsParent-constrained Lux $f_i$ / ODE residualsMechanismSpec, MechanismLibrary, build_ode_rhs, train_mechanisms! (Lux weakdep)
Generative L3Additive-noise abduction on codesabduce_noise, mechanism_counterfactual (:generative)
Soft interventionsState-dependent treatment rulesPolicy, policy
Interventional meansMonte Carlo g-computation (discrete)g_computation on DiscreteTimeCDM
Continuous functionalsMonte Carlo g-computation (SciML)ContinuousEffectFunctional, g_computation on ContinuousCDMSpec
Time-indexed IDUnrolled lag DAGs; support-driven node multiplicityTemporalNodeSpec, TemporalDAGSpec, unroll_temporal_dag, causal_projection, temporal_backdoor_adjustment_set
Transport IDDomain covariates in adjustmentTransportQuery → :transport_backdoor

Hard dependencies stay lean: Graphs and CausalInference (d-separation, backdoor, and frontdoor adjustment via gensearch). IV, path enumeration, SCM/CDM simulation, and estimation bridges are owned here.

What is optional

  • DAGMakie.jl — weakdep plotting (plot_causal_graph, …)
  • Associations.jl — weakdep discovery bridge (PC, OCE → identification); see Associations integration
  • RxInfer / GraphPPL / DataFrames — weakdep variational backdoor head (narrow residualised ATE; see RxInfer integration); DataFrame(::CDMPanel) via CausalDynamicsDataFramesExt
  • TMLE.jl — workflow helpers when the package is loaded (prepare_for_tmle)
  • CausalTargeted.jl — sequential LMTP consumes simulate_panel wide tables + temporal IdentificationResult (plan_sequential / sequential_spec_from_identification)

What is not in core

ConcernWhere it lives
LMM / MixedModels fittingApplication repos (or RxInfer hierarchical demos); see examples/hierarchical_mixedmodels_concordance.md
Discovery algorithms (PC, OCE, CCM, …)Associations.jl (optional weakdep bridge)
ODE/SDE/UDE solversSciML (OrdinaryDiffEq, UniversalDiffEq, …); CausalDynamics supplies structure and do semantics
DeepSCM / non-additive image L3 encodersDeferred; Phase 2b is additive-noise :generative on codes
UniversalDiffEq hard dependencyDeferred; optional advanced trainer only (SCIML recipes)
Flux-in-coreDeferred; Flux via MLJFlux / application encoders; Lux for mechanisms
Full MIRS / Twins cohort fixturesDeferred; synthetic spectra in docs/stress/
Full symbolic do-calculus / ModelingToolkit IDStubs only (is_identifiable, SymbolicSCM); unexported until implemented
Relational identification across unseen skeletonsGrounding prototype only; mechanism invariance and transport assumptions remain caller-specified
Process metaphysics vocabularyCDCS book prose, not package exports

Experimental (exported, quarantined)

APIStatus
HypergraphHigher-order edges; not used by identify or CDM simulation
Relational groundingSchema/skeleton expansion only; not relational identification or estimation
SymbolicSCMModelingToolkit placeholder (system::Any); use GraphSCM for executable SCMs

Façade vs own code

  • Façades over CausalInference: d_separated → dsep; backdoor adjustment → CausalInference gensearch (van der Zander et al., 2019); frontdoor adjustment → find_frontdoor_adjustment (Wienöbst et al., 2024).
  • Own code: instruments, path finding, ancestral sets, GraphSCM, DiscreteTimeCDM, TMLE/RxInfer/DAGMakie/Associations bridges.

Version narrative

  • 0.1 — static graphs, identification façades, GraphSCM
  • 0.2 — DiscreteTimeCDM trajectories (book Ch. 28); time-indexed unrolling
  • 0.3 — Associations.jl discovery bridge; prepare_from_discovery, OCE → TemporalDAGSpec

See also