Papers
Topics
Authors
Recent
Search
2000 character limit reached

DoFlow: Causal Flows for Time-Series

Updated 9 November 2025
  • DoFlow is a framework for causal time-series prediction that integrates continuous normalizing flows, structural causal models, and neural ODEs to address observational, interventional, and counterfactual queries.
  • It employs per-node neural ODE-based flows conditioned on DAG-structured dependencies, enabling explicit likelihood computations and principled anomaly detection.
  • Empirical studies on synthetic, hydropower, and cancer treatment data demonstrate significant improvements in RMSE and predictive reliability over conventional deep learning models.

DoFlow refers to "DoFlow: Causal Generative Flows for Interventional and Counterfactual Time-Series Prediction" (Wu et al., 4 Nov 2025), a framework uniting continuous normalizing flows (CNFs), structural causal modeling (SCM), and neural ODEs for time-series forecasting under both observational and causal queries on systems structured by a known directed acyclic graph (DAG). DoFlow is designed to answer not just observational (“what will happen?”) forecasts, but also interventional (“what if we do XX?”) and counterfactual (“what would have happened if we did XX' instead?”) queries, with explicit likelihoods for proper statistical inference and anomaly detection.

1. Problem Formulation and Causal Setting

The DoFlow framework considers a multivariate time series {Xt}t=1T\{X_t\}_{t=1}^T, where XtRKX_t \in \mathbb{R}^K, and leverages a DAG G\mathcal{G} over nodes 1,,K1,\ldots,K to encode instantaneous causal dependencies: if jpa(i)j\in\mathrm{pa}(i), then Xj,tXi,tX_{j,t} \rightarrow X_{i,t} (with pa(i)\mathrm{pa}(i) denoting the parent set). Each node ii evolves according to a (possibly nonlinear) structural equation: XX'0 where XX'1 and XX'2 denote the past values, and XX'3 are independent exogenous (noise) variables.

Forecasting tasks in this setting are divided as:

  • Observational forecasting: Estimate XX'4.
  • Interventional forecasting: For an intervention schedule XX'5, with values XX'6, estimate XX'7.
  • Counterfactual forecasting: Given realized XX'8 (the factual trajectory) and counterfactual interventions, infer XX'9 with the same {Xt}t=1T\{X_t\}_{t=1}^T0 that generated the factual path.

2. Architecture: Continuous Normalizing Flows on a Causal DAG

DoFlow employs a per-node, per-timestep continuous normalizing flow:

  • For each node {Xt}t=1T\{X_t\}_{t=1}^T1 and forecast step {Xt}t=1T\{X_t\}_{t=1}^T2, a neural ODE parameterizes the bijection between Gaussian noise {Xt}t=1T\{X_t\}_{t=1}^T3 and {Xt}t=1T\{X_t\}_{t=1}^T4, conditioned on recurrent states {Xt}t=1T\{X_t\}_{t=1}^T5 summarizing its and its parents' past.
  • For each {Xt}t=1T\{X_t\}_{t=1}^T6, consider the path {Xt}t=1T\{X_t\}_{t=1}^T7, {Xt}t=1T\{X_t\}_{t=1}^T8, governed by

{Xt}t=1T\{X_t\}_{t=1}^T9

with XtRKX_t \in \mathbb{R}^K0 and XtRKX_t \in \mathbb{R}^K1.

  • The forward (“encoding”) direction maps base noise to data; the reverse allows likelihood computation and inference.

The joint density over the forecast window is autoregressive: XtRKX_t \in \mathbb{R}^K2 where XtRKX_t \in \mathbb{R}^K3.

3. Learning via Conditional Flow Matching

The flow vector fields XtRKX_t \in \mathbb{R}^K4 are trained using a conditional flow matching (CFM) criterion:

  • For each training triple XtRKX_t \in \mathbb{R}^K5, linearly interpolate XtRKX_t \in \mathbb{R}^K6,
  • The loss is

XtRKX_t \in \mathbb{R}^K7

This loss aligns the learned velocity field XtRKX_t \in \mathbb{R}^K8 along interpolants between data and base noise, facilitating stable and expressive conditional flows adapted to the marginal dynamics of each node conditional on its Markov blanket.

4. Causal Interventions, Counterfactuals, and Theoretical Guarantees

Interventional Forecasting

At inference, the system proceeds stepwise in DAG topological order:

  • For each node XtRKX_t \in \mathbb{R}^K9 at time G\mathcal{G}0:
    • If G\mathcal{G}1: set G\mathcal{G}2 (explicit intervention).
    • Else: sample G\mathcal{G}3 and decode G\mathcal{G}4.
  • Recurrent hidden states for G\mathcal{G}5 and its children are then updated and the process continues for subsequent times and nodes.

Counterfactual Forecasting

DoFlow implements the abduction-action-prediction paradigm for counterfactuals:

  1. Abduction: Encode the factual trajectory G\mathcal{G}6 one step at a time to obtain latent codes G\mathcal{G}7.
  2. Action: For intervention points, set G\mathcal{G}8; for others, reuse G\mathcal{G}9.
  3. Prediction: Decode each latent using the counterfactual history 1,,K1,\ldots,K0:

1,,K1,\ldots,K1

producing a deterministic trajectory that is consistent with the original 1,,K1,\ldots,K2.

Counterfactual Recovery Theorem

Under assumptions:

  • (A1) 1,,K1,\ldots,K3 is independent of all previous variables.
  • (A2) 1,,K1,\ldots,K4 is strictly monotone in 1,,K1,\ldots,K5.
  • (A3) In the infinite-data limit, 1,,K1,\ldots,K6 is standard normal and independent of 1,,K1,\ldots,K7.

It follows:

  • The flow encoder maps 1,,K1,\ldots,K8 to a 1,,K1,\ldots,K9 that depends only on jpa(i)j\in\mathrm{pa}(i)0 (not jpa(i)j\in\mathrm{pa}(i)1).
  • Decoding jpa(i)j\in\mathrm{pa}(i)2 under counterfactual parent trajectories recovers jpa(i)j\in\mathrm{pa}(i)3 as under the true SCM.
  • This theoretical guarantee ensures that the encode–do–decode mechanism implemented in DoFlow is sound in the limit for univariate, monotonic SCMs, and suggests wider applicability in practice given similar regularities in the learned flows.

5. Applications: Likelihood-based Anomaly Detection and Empirical Results

DoFlow is evaluated on both synthetic and real-world time-series data in settings requiring causal forecasting:

Synthetic DAG-structured Systems

  • Supports various causal graph structures: Chain, Tree, Diamond, Fully-Connected-Layer, with both additive and non-additive (nonlinear) SCMs.
  • Metrics:
  • Empirical findings:
    • DoFlow outperforms GRU, TFT, TiDE, TSMixer, DeepVAR, and MQF2 on observational and interventional RMSE/MMD.
    • It is the only method with nontrivial counterfactual RMSE, i.e., capable of explicit, data-consistent what-if predictions.

Hydropower System (Real Data)

  • 8-node DAG: turbine vibrations, generator signals, transformer outputs, and control units.
  • Experiments:
    • Interventional forecasting is validated by simulating turbine failures (power-outages).
    • Early anomaly detection is demonstrated: log-likelihood dips identify emerging faults 10–20 minutes before actual outages.
    • Interventional RMSE is substantially lower than adapted black-box baselines.

Cancer Treatment Time-Series

  • Nodes: four treatments (chemo/radiotherapy, with dose schedules) as parents of tumor volume jpa(i)j\in\mathrm{pa}(i)4 in single-step DAG.
  • Experimental protocol:
    • First 55 days observed per patient; days 56–62 rolled out for 10 hypothetical treatment regimens.
    • RMSE measured against ground-truth generated by adversarially-balanced SCMs.
  • DoFlow reduces normalized RMSE by approximately 50% compared to CRN, RMSN, and MSM baselines for treatment effect estimation.

Likelihood-based Anomaly Detection

  • Every generated trajectory has an explicit log-likelihood.
  • Anomalous events are detected by thresholding jpa(i)j\in\mathrm{pa}(i)5.
  • In hydropower and synthetic domains, this enables principled, model-aware diagnosis of rare system behaviors.

6. Framework Significance, Trade-offs, and Broader Implications

DoFlow synthesizes causal SCMs, normalizing flows, temporal recurrence, and neural ODE machinery to operationalize the full spectrum of time-series causal inference:

Capability DoFlow Implementation
Observational forecasting CNF roll-out, recurrent, explicit density
Interventional (do-operator) Intervention per node/time, DAG topological pass
Counterfactual ("encode-do-decode") Abduct latent, intervene, conditionally decode
Anomaly detection Likelihood thresholding along roll-outs

Resource requirements are mainly determined by neural ODE integration per node per time step, with recurrence for history; scalability tracks that of modern CNF ODE solutions and RNNs.

Salient trade-offs:

  • Expressivity vs. computational cost: Per-node flows avoid the curse of dimensionality but require parallel ODE solves.
  • Theoretical identifiability: Guarantees hinge on monotonicity and independence assumptions; complex SCMs with unobserved confounding may violate these, but practical benefit has been observed in heterogeneous domains.
  • Interpretability: The DAG-structured flows maintain explicit causal semantics, facilitating interventional science and policy queries, unlike black-box sequence models.

DoFlow thus advances unification of generative modeling and causal inference in dynamical systems, opening principled paths for "what-if" reasoning and risk assessment in domains such as industrial process control, medicine, and physical system modeling.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to DoFlow.