Skip to main content

CausalCompass: Evaluating the Robustness of Time-Series Causal Discovery in Misspecified Scenarios

NeurIPS 2026

Project Page arXiv Documentation Datasets PyPI GitHub License: MIT

CausalCompass is a Python package that provides a flexible and extensible benchmark framework for evaluating the robustness of time-series causal discovery (TSCD) methods under misspecified modeling assumptions. For more details, please refer to the Document.

AUPRC Performance Radar Plot


Abstract

Causal discovery from time series is a fundamental task in machine learning. However, its widespread adoption is hindered by a reliance on untestable causal assumptions and by the lack of robustness-oriented evaluation in existing benchmarks. To address these challenges, we propose CausalCompass, a flexible and extensible benchmark framework designed to assess the robustness of time-series causal discovery (TSCD) methods under violations of modeling assumptions. To demonstrate the practical utility of CausalCompass, we conduct extensive benchmarking of representative TSCD algorithms across eight assumption-violation scenarios. Our experimental results indicate that no single method consistently attains optimal performance across all settings. Nevertheless, in most scenarios, the methods exhibiting superior overall performance are deep learning-based approaches. We further provide hyperparameter sensitivity analyses to deepen the understanding of these findings. We additionally conduct ablation experiments to explain the strong performance of deep learning-based methods under assumption violations. We also find that NTS-NOTEARS relies on standardized preprocessing in practice, performing poorly in the vanilla setting but exhibiting strong performance after standardization. Finally, our work aims to provide a comprehensive and systematic evaluation of TSCD methods under assumption violations, thereby facilitating their broader adoption in real-world applications. The user-friendly implementation, documentation and datasets are available at https://github.com/huiyang-yi/CausalCompass.

Key Features

  • 8 assumption-violation scenarios: Confounders, nonstationarity, measurement error, standardization, missing data, mixed data, min-max normalization, and trend/seasonality
  • 2 vanilla models: VAR (linear) and Lorenz-96 (nonlinear)
  • 11 TSCD algorithms spanning 6 major methodological categories:
    • Granger causality-based: VAR, LGC
    • Constraint-based: PCMCI
    • Noise-based: VARLiNGAM
    • Score-based: DYNOTEARS, NTS-NOTEARS
    • Topology-based: TSCI
    • Deep learning-based: cMLP, cLSTM, CUTS, CUTS+

Datasets

The benchmark datasets are available on Kaggle. Dataset-generation functions are provided in causalcompass/datasets/.

The generated datasets follow the naming convention:

[scenario]_[params]_[model]_p[p]_T[T]_[optional]_seed[seed].npz

Example: confounder_rho0.5_VAR_p10_T1000_seed0.npz

Installation

Install with pip

# 1. Create a clean conda environment
conda create -n causalcompass-env python=3.10 -y
conda activate causalcompass-env

# 2. Install causalcompass from PyPI
pip install causalcompass

# 3. Verify installation
pip show causalcompass
python -c "import causalcompass; print(dir(causalcompass))"

Usage Example

from causalcompass.datasets.measurement_error import simulate_var_with_measure_error
from causalcompass.algorithms import PCMCI

# Step 1: Generate VAR data with measurement error
p, T, lag, seed = 10, 500, 3, 0
gamma = 1.2  # measurement error scale factor

data, beta, true_adj = simulate_var_with_measure_error(
    p=p, T=T, lag=lag, gamma=gamma, seed=seed
)
print(f"Data shape: {data.shape}")              # (500, 10)
print(f"Ground truth shape: {true_adj.shape}")  # (10, 10)

# Step 2: Initialize and run the algorithm
model = PCMCI(tau_max=3, pc_alpha=0.05, alpha=0.05)
predicted_adj = model.run(data)

# Step 3: Evaluate
all_metrics, no_diag_metrics = model.eval(
    true_adj,
    predicted_adj,
    shd_thresholds=[0, 0.01, 0.05, 0.1, 0.3],
)
print(f"AUROC: {all_metrics['auroc']:.3f}")
print(f"AUPRC: {all_metrics['auprc']:.3f}")
print(f"NSHD: {all_metrics['shd']:.3f}")  # shd stores normalized SHD (NSHD)
print(f"AUROC (no diag): {no_diag_metrics['auroc']:.3f}")
print(f"AUPRC (no diag): {no_diag_metrics['auprc']:.3f}")
print(f"NSHD (no diag): {no_diag_metrics['shd']:.3f}")  # shd stores normalized SHD (NSHD)

Citation

If you find this work useful, please cite our paper:

@article{yi2026causalcompass,
  title={CausalCompass: Evaluating the Robustness of Time-Series Causal Discovery in Misspecified Scenarios},
  author={Yi, Huiyang and Shen, Xiaojian and Wu, Yonggang and Chen, Duxin and Wang, He and Yu, Wenwu},
  journal={arXiv preprint arXiv:2602.07915},
  year={2026}
}

License

  • The code in this repository is released under the MIT License.
  • The datasets generated and provided by this repository are released under the CC BY 4.0 License.

Contributing

Contributions are welcome! If you encounter bugs, have suggestions for improvements, or would like to extend CausalCompass with additional assumption-violation scenarios or evaluation protocols, please feel free to open an issue or submit a pull request.

Contact

For questions or issues, please:

Metadata

Release files for causalcompass 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for causalcompass 0.2.0
File Size Uploaded Provenance Actions
causalcompass-0.2.0.tar.gz 200.5 kB Without provenance Details for causalcompass-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for causalcompass 0.2.0
File Interpreter ABI Platform Actions
causalcompass-0.2.0-py3-none-any.whl Python 3 none any Details for causalcompass-0.2.0-py3-none-any.whl

Total release size: 501.2 kB

Release files / causalcompass-0.2.0.tar.gz

Download URL causalcompass-0.2.0.tar.gz
Size 200.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a0b002990814f2dede1e20959a1ae9f32dbb6efa411a8f64f87e0f69abdb288d
BLAKE2b-256 checksum
How to use checksums
6b8959665e75f3481fcda1962bf845a6c4dff5bce7bb56897889f4a63e0f94f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / causalcompass-0.2.0-py3-none-any.whl

Download URL causalcompass-0.2.0-py3-none-any.whl
Size 300.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
120b9e3dc7d8dfade0050f76106d0f3d68e0d92b545db71997751edf7293cce9
BLAKE2b-256 checksum
How to use checksums
d7304eb61c19c946d6f502523695b37ee2f23e1e1362f6ca98607f1d1ab4f560
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Security for causalcompass 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page