Beyond Stationarity in Time Series: Discovering Causal Structures and Latent Regimes via Markov Blankets
Authors: Lei Zan, Charles K. Assaad, Emilie Devijver, Eric Gaussier
Organizations: Univ. Grenoble Alpes, CNRS, Grenoble INP, LIG, Grenoble, France · Sorbonne Université, INSERM, Institut Pierre Louis d’Epidémiologie et de Santé Publique, F75012, Paris, France
This paper introduces Regime-aware Constraint-Based and Noise-Based causal discovery with Markov Blankets (RCBNB-MB), a novel causal discovery algorithm for time series that relaxes the common assumption of a single, time-consistent causal structure. Time series are typically observed at discrete time points and often exhibit regime changes that challenge the assumption of a static causal structure, a limitation in many real-world dynamic systems. To address this challenge, RCBNB-MB identifies latent causal regimes, defined as subsets of time points within which a stable causal structure holds. The algorithm follows an iterative strategy that segments the time series into regimes and discovers the causal graph within each regime. By leveraging the Markov blanket rather than direct parents, RCBNB-MB gains robustness to errors in causal discovery and preserves predictive information. We provide theoretical guarantees for RCBNB-MB's ability to recover both regime transitions and causal graphs under reasonable assumptions. Furthermore, we validate its effectiveness through extensive experiments on simulated datasets with known ground truth and real-world IT monitoring data, where taking into account regime shifts is critical. Empirical results show that RCBNB-MB systematically outperforms baseline approaches in accurately detecting regime changes and their associated causal graphs, positioning it as a robust and versatile framework for non-stationary time series analysis.
Figures & tables
Method
Regimes
Temporal
Contemp.
Fixed
Prediction
Lags
Effects
Causal Order
CD-NOD [ 14 ]
Segmentation
✓
✓
×
×
J(oint)-PCMCI + [ 11 ]
Input
✓
✓
×
×
LoSST [ 16 ]
Mahalanobis distance
×
×
×
×
SPACETIME [ 18 ]
Learnt
✓
✓
✓
PA
SDCI [ 27 ]
Learnt
✓
×
×
PA
Table 1: Comparison of causal discovery methods for non-stationary time series. PA and MB denote the parent set and Markov blanket, respectively.
Figure 1: Two graphic causal relation representations for time series with two distinct regimes: (a) full time causal graphs from two distinct regimes (b) window causal graphs from two distinct regimes. The variable Ct is latent and has to be inferred.
Figure 2: Illustration of our method. Left: an example of a dataset with 6 time series, which violates the causal stationarity assumption. Middle: flowchart of our iterative method through the two steps: causal discovery and regime detection. Right: results of our method on this dataset: two regimes are considered, and we display the two causal graphs and the regime assignment.
2 regimes
3 regimes
MER
Total
Lagged
Instant
nSHD
MER
Total
Lagged
Instant
nSHD
RCBNB-MB
1.27 %
0.73
0.77
0.67
0.52
0.81 %
0.66
0.71
0.58
0.55
RCBNB-PA
1.27 %
0.69
0.73
0.62
0.54
2.93 %
0.65
0.69
0.57
0.57
RPCMCI-MB
0.24 %
0.57
0.65
×
1.03
0.39 %
0.54
0.62
×
1.07
RPCMCI-PA [ 32 ]
1.26 %
0.57
0.66
×
1.00
0.35 %
0.55
0.63
×
1.04
RPCMCI + -MB
1.27 %
0.64
0.70
0.46
0.60
2.95 %
0.55
0.62
0.39
0.56
Table 2: Results on generated data. The Mean Error Rate (MER), the mean F1-score, and the mean normalized Structural Hamming Distance (nSHD) across two scenarios: 2 regimes and 3 regimes . The F1-score is evaluated under three conditions: Total (all edges considered), Lagged (only lagged edges considered), and Instant (only instantaneous edges considered). Reported values are means over 50 repetitions, with time series of length 600.
Figure 3: RCBNB-MB assignments assuming 3 regimes (top) and 2 regimes (bottom). Blue denotes normal regime, while rose and green denote abnormal regimes. The circle ( ∘ ) and cross ( × ) mark the expert identified anomaly start and end at timestamps 46,683 and 46,783, respectively.
loss
F1-score in normal regimes
2 regimes
3.56
0.53
3 regimes
3.02
0.53
Table 3: Results on real data. The F1-score for each regime is computed for our method RCBNB-MB, with 2 and 3 regimes.
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 4: Sensitivity analysis of RCBNB-MB with respect to three hyperparameters: the number of initialization points Ni (top row), the maximum number of optimization iterations No (middle row), and the minimum size per regime Nℓ (bottom row). The left and right columns report the mean F1-score with standard deviation and the mean MER, respectively, evaluated over 50 simulated datasets with a time series length of 600.
Table 4: The Mean Error Rate (MER), the F1-score, and the normalized Structural Hamming Distance (nSHD) across two scenarios: 2 regimes and 3 regimes . The F1-score is evaluated under three conditions: Total (all edges considered), Lagged (only lagged edges considered), and Instant (only instantaneous edges considered). The reported values are based on 50 repetitions, with each time series having a length of 1,200.
Equal Regime Sizes
2 regimes
3 regimes
Total
Lagged
Instant
nSHD
Total
Lagged
Instant
nSHD
RCBNB-MB
0.01
0.01
0.02
0.04
0.01
0.01
0.03
0.01
RCBNB-PA
0.03
0.03
0.04
0.04
0.02
0.02
0.03
0.04
RPCMCI-MB
<0.01
0.01
×
0.06
<0.01
<0.01
×
0.02
RPCMCI-PA
0.01
0.01
×
0.07
<0.01
<0.01
×
0.02
Appendix
Table 5: Variance of the F1-score and the normalized Structural Hamming Distance (nSHD) across two scenarios: 2 regimes and 3 regimes . For each scenario, the F1-score is evaluated under three conditions: Total (all edges considered), Lagged (only lagged edges considered), and Instant (only instantaneous edges considered). Additionally, only oriented edges are considered. The reported values are based on 50 repetitions. Each time series has a length of 600, with the disturbance term distributed as ϵtj∼U(−0.1,0.1) .
Table 6: Unequal Regime Sizes. The Mean Error Rate (MER), the F1-score, and the normalized Structural Hamming Distance (nSHD) across two scenarios: 2 regimes and 3 regimes . The F1-score is evaluated under three conditions: Total (all edges considered), Lagged (only lagged edges considered), and Instant (only instantaneous edges considered). The reported values are based on 50 repetitions. The data generation process follows Equation 8 . The only difference compared to Section 5.1 is that the regime sizes are randomly determined, with the constraint that each regime occupies at least 10 % of the time series and remains contiguous (i.e., without interruptions).
Table 7: Unequal regime sizes. Variance of the F1-score and the normalized Structural Hamming Distance (nSHD) across two scenarios: 2 regimes and 3 regimes . The variance is evaluated under three conditions: Total (all edges considered), Lagged (only lagged edges considered), and Instant (only instantaneous edges considered). The reported values are based on 50 repetitions. The data generation process follows Equation 8 . The only difference compared to Section 5.1 is that the regime sizes are randomly determined, with the constraint that each regime occupies at least 10 % of the time series and remains contiguous (i.e., without interruptions).
Table 8: The Mean Error Rate (MER), the F1-score and the normalized Structural Hamming Distance (nSHD) in the 2 regimes scenario with 15 variables and unequal regime sizes. The F1-score is evaluated under three conditions: Total (all edges considered), Lagged (only lagged edges considered), and Instant (only instantaneous edges considered). The reported values are based on 50 repetitions, with each time series having a length of 2,000.
We describe Causal-TS, an open-source Python library for causal discovery in high-dimensional and nonstationary multivariate time series. Causal-TS provides four specialized algorithms-CDNOTS, CDNOTS+, CEDAR, and GRACE-along with wrappers for GES, Granger, LASSO-VAR, and LGES, all sharing a unified conditional independence (CI) test layer with GPU acceleration via PyTorch. A regime discovery pipeline detects structural breaks via pluggable changepoint detectors and runs discovery per regime with regime-specific parameters. A command-line interface, synthetic data generators, and optional DoWhy integration provide an end-to-end pipeline from raw time series to causal effect estimates. The library is pip-installable, tested on Python 3.10--3.12, and available at https://github.com/bloomberg/causal-ts.
The widespread availability of complex time series data in various domains such as environmental science, epidemiology, and economics demands robust causal discovery methods that can identify intricate contemporaneous and lagged relationships in non-stationary, nonlinear, and noisy settings. Existing constraint-based methods often rely heavily on conditional independence tests that degrade for limited data samples and complex distributions, while score-based methods impose strong statistical assumptions. Recent methods address special cases such as change point detection or distribution shifts, but struggle to provide a unified solution. We propose the Transformer Integrated Temporal Causal Discovery (TTCD) Framework, a novel end-to-end approach that learns contemporaneous and lagged causal relations from non-stationary time series. TTCD introduces a Non-Stationary Feature Learner integrating temporal and frequency-domain attention with dynamic non-stationarity profiling, and a custom Causal Structure Learner. A key innovation is reconstruction-guided causal signal distillation, to distill essential causal signals through the reconstruction process of the transformer decoder, which mitigates noise and spurious correlations while preserving meaningful dependencies. The Causal Structure Learner operates on distilled reconstructed signals to infer the underlying causal graph without restrictive assumptions on noise distributions or data generation processes. Experiments on synthetic, benchmark, and real world datasets show that TTCD consistently outperforms state-of-the-art baselines in both accuracy and consistency with domain knowledge, demonstrating the approach's effectiveness for causal discovery in challenging real world contexts.
Omar Faruque, Sahara Ali, Xue Zheng +1
Department of Information Systems University of Maryland, Baltimore County Baltimore, Maryland, USA · Department of Data Science University of North Texas Denton, Texas, USA · Climate Science Section Lawrence Livermore National Laboratory Livermore, California, USA
Temporal systems often exhibit non-stationary behaviour, such as seasonal climate variation or glucose fluctuations in patients with type-1 diabetes. One way to model non-stationarity is through discrete latent regimes, i.e., stationary segments of time. Such systems induce a Markov Switching Model (MSM), a class of Hidden Markov Models with autoregressive dependencies among latent regimes and observed variables. Identifying latent regimes is challenging in the presence of frequent regime switches and nonlinear and non-Gaussian dynamics, particularly when there are instantaneous effects between the variables, e.g., due to slow rates of measurements. In this work, we establish the identifiability of both latent regimes and regime-dependent causal structures under temporal regime dependencies, nonlinear lagged and instantaneous effects, and independent noise from the exponential family. Our identifiability theory subsumes non-temporal mixtures of causal models. Furthermore, we introduce FlowMSM, a regime detection framework that can be paired with any stationary causal discovery method to recover regime-dependent causal structures. Experiments on synthetic benchmarks and a financial economics dataset demonstrate the effectiveness of our approach to detect latent regimes and discover causal structures from non-stationary time series.
Roel Hulsman, Carles Balsells-Rodas, Sara Magliacane
University of Amsterdam · 2Adyen · 3Imperial College London +1