causalcompass.algorithms.VARLiNGAM

class causalcompass.algorithms.VARLiNGAM(tau_max=3, varlingamalpha=0.01, seed=None)[source]

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

References

https://github.com/ckassaad/causal_discovery_for_time_series

Parameters:
  • tau_max (int, default 3) – Maximum time lag

  • varlingamalpha (float, default 0.01) – Threshold for VARLiNGAM

  • seed (int, default None) – Random seed for reproducibility

Examples

>>> from causalcompass.algorithms import VARLiNGAM
>>> model = VARLiNGAM(tau_max=3, varlingamalpha=0.01, seed=0)
>>> predicted_adj = model.run(X)
>>> all_metrics, no_diag_metrics = model.eval(true_adj, predicted_adj)
__init__(tau_max=3, varlingamalpha=0.01, seed=None)[source]

Initialize VARLiNGAM

Methods

__init__([tau_max, varlingamalpha, seed])

Initialize VARLiNGAM

eval(true_adj, predicted_adj[, shd_thresholds])

Evaluate the predicted adjacency matrix against the ground truth.

run(X)

Run VARLiNGAM algorithm.

run_raw(X)

Run the algorithm and return an unthresholded intermediate result that can be reused across multiple threshold values.

run_threshold_sweep(X, thresholds)

Run the algorithm once and post-process the raw result for each threshold.