Bloomberg 开源了 Causal-TS,专门处理高维、非平稳时间序列的因果发现,比通用库多了专用算法和 GPU 加速,还有断点检测功能,做时序因果分析可以试试。
Causal-TS 是一个开源 Python 库,专为高维和非平稳多变量时间序列的因果发现设计。它提供了四种专用算法 CDNOTS、CDNOTS+、CEDAR 和 GRACE,并集成了 GES、Granger、LASSO-VAR 和 LGES 等现有方法的包装器。所有算法共享一个基于 PyTorch 的 GPU 加速条件独立性测试层。库中还包含一个体制发现管道,通过可插拔的变点检测器识别结构断点,并对每个体制独立运行因果发现。Causal-TS 支持 Python 3.10 至 3.12,可通过 pip 安装,并可选集成 DoWhy 进行因果效应估计。
Causal-TS: A Python Library for Causal Discovery in High-Dimensional and Nonstationary Time Series
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.