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. Process/Whitehead gloss lives in the book (Concept Reference Table 8); package names stay Pearl/SciML-facing.
What is in core (v0.1–v0.2)
| Layer | Role | Typical API |
|---|---|---|
| Graphs | DAG validation, ancestral sets, paths | is_dag, get_ancestors, find_backdoor_paths |
| Identification | Criteria for adjustment / instruments | d_separated, backdoor_adjustment_set, frontdoor, IV |
| Static SCM | One-shot settlement given U | GraphSCM, DoIntervention, simulate_scm, compute_counterfactual |
| Discrete-time CDM | Trajectories over occasions | DiscreteTimeCDM, DoSequence, simulate, counterfactual |
| Soft interventions | State-dependent treatment rules | Policy, policy |
| Interventional means | Monte Carlo g-computation | g_computation |
| Time-indexed ID | Unrolled lag DAGs | TemporalDAGSpec, unroll_temporal_dag, temporal_backdoor_adjustment_set |
Hard dependencies stay lean: Graphs and CausalInference (d-separation and minimal backdoor algorithms). Frontdoor, 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)
- TMLE.jl — workflow helpers when the package is loaded (
prepare_for_tmle)
What is not in core
| Concern | Where it lives |
|---|---|
| Discovery algorithms (PC, OCE, CCM, …) | Associations.jl (optional weakdep bridge) |
| ODE/SDE/UDE solvers | SciML (OrdinaryDiffEq, UniversalDiffEq, …); CausalDynamics supplies structure and do semantics |
| Full symbolic do-calculus / ModelingToolkit ID | Stubs only (is_identifiable, SymbolicSCM); unexported until implemented |
| Process metaphysics vocabulary | CDCS book prose, not package exports |
Experimental (exported, quarantined)
| API | Status |
|---|---|
Hypergraph | Higher-order edges; not used by identify or CDM simulation |
SymbolicSCM | ModelingToolkit placeholder (system::Any); use GraphSCM for executable SCMs |
Façade vs own code
- Façades over CausalInference:
d_separated→dsep;backdoor_adjustment_set/ adjustment listing → CausalInference backdoor helpers. - Own code: frontdoor, instruments, path finding, ancestral sets,
GraphSCM,DiscreteTimeCDM, TMLE/RxInfer/DAGMakie/Associations bridges.
Version narrative
- 0.1 — static graphs, identification façades,
GraphSCM - 0.2 —
DiscreteTimeCDMtrajectories (book Ch. 28); time-indexed unrolling - 0.3 — Associations.jl discovery bridge;
prepare_from_discovery, OCE →TemporalDAGSpec