API Reference

Import causalcompass as:

import causalcompass

CausalCompass provides data generation functions for both VAR (linear) and Lorenz-96 (nonlinear) models across multiple assumption-violation scenarios. All data generation functions are located under causalcompass.datasets. All algorithms are located under causalcompass.algorithms.

Data Generation

datasets.vanilla.simulate_var

Generate time series data from a Vector Autoregressive (VAR) model.

datasets.vanilla.simulate_lorenz_96

Generate time series data from the Lorenz-96 dynamical system.

datasets.measurement_error.simulate_var_with_measure_error

Generate VAR data with measurement error proportional to data variance.

datasets.measurement_error.simulate_lorenz_with_measure_error

Generate Lorenz-96 data with measurement error.

datasets.mixed_data.generate_mixed_var

Generate VAR data where a proportion of variables are discretized.

datasets.mixed_data.generate_mixed_lorenz_96

Generate Lorenz-96 data where a proportion of variables are discretized.

datasets.standardized.generate_standardized_var

Generate VAR data with z-score or min-max normalization applied.

datasets.standardized.generate_standardized_lorenz_96

Generate Lorenz-96 data with normalization applied.

datasets.confounder.simulate_var_with_confounders

Generate VAR data with cross-lag hidden confounders that introduce spurious correlations.

datasets.confounder.simulate_lorenz_with_confounders

Generate Lorenz-96 data with hidden confounders.

datasets.missing.generate_missing_var

Generate VAR data with missing values and interpolation.

datasets.missing.generate_missing_lorenz_96

Generate Lorenz-96 data with missing values and interpolation.

datasets.trendseason.simulate_var_with_trend_season

Generate VAR data with additive trend and seasonal components.

datasets.trendseason.simulate_lorenz_with_trend_season

Generate Lorenz-96 data with additive trend and seasonal components.

datasets.nonstationary.simulate_nonstationary_var

Generate VAR data with time-varying noise variance (driven by Gaussian Process).

datasets.nonstationary.simulate_nonstationary_var_timevarying_coef

Generate VAR data with both time-varying coefficients and time-varying noise.

datasets.nonstationary.simulate_nonstationary_lorenz_96

Generate Lorenz-96 data with time-varying noise variance.

Algorithms

algorithms.VAR

Granger causality-based causal discovery method that fits a Vector Autoregressive model and infers causal relationships from the estimated coefficient matrix.

algorithms.LGC

Granger causality-based causal discovery method that augments the VAR model with a Lasso penalty term.

algorithms.VARLiNGAM

Noise-based causal discovery method that combines Vector Autoregressive model with Linear Non-Gaussian Acyclic Model (LiNGAM) for time series data.

algorithms.PCMCI

Constraint-based causal discovery method that combines the PC algorithm with Momentary Conditional Independence tests for time series data.

algorithms.DyNotears

Score-based causal discovery method that extends the NOTEARS framework to dynamic (time series) settings using continuous optimization with acyclicity constraints.

algorithms.NTSNotears

NTS-NOTEARS is a score-based nonlinear extension of DYNOTEARS.

algorithms.TSCI

Topology-based causal discovery method that leverages Takens’ state-space reconstruction theory to infer causality.

algorithms.CMLP

Deep learning-based causal discovery method that uses component-wise MLPs to model nonlinear Granger causality.

algorithms.CLSTM

Deep learning-based causal discovery method that uses component-wise LSTMs to model nonlinear Granger causality.

algorithms.CUTS

CUTS is a deep learning-based causal discovery method tailored for irregular time series data.

algorithms.CUTSPlus

CUTS+ extends the original CUTS framework.