Skip to main content

Causal-Audit

Python 3.13 License: MIT Tests: 27/27

📄 Paper (arXiv:2604.02488)

Framework overview (Figure 1). Stage I computes diagnostics across five assumption families. Stages II–III add calibrated risk scores and an abstention-aware decision policy.

A framework for risk assessment of assumption violations in time-series causal discovery.

Ruiz, M.¹, Arana-Catania, M.², Ardila, D. R.³ & Ventura, R.¹ (2026). Journal of Causal Inference.

¹ ISR, Instituto Superior Técnico, Lisbon   ² University of Oxford   ³ Jet Propulsion Laboratory, Caltech

Contents

Install

Users

Install the released package with uv (recommended) or pip:

uv pip install causal-audit
# or
pip install causal-audit

Optional extras pull in the figure and graph dependencies:

uv pip install "causal-audit[viz]"     # IEEE-style figures (SciencePlots)
uv pip install "causal-audit[graphs]"  # optional exploratory PCMCI+ graph via tigramite
uv pip install "causal-audit[all]"     # viz + graphs + earth-observation helpers

The package installs as causal-audit and imports as causal_audit.

Contributors

Clone the repository and install an editable copy into a fresh environment:

git clone https://github.com/marcoruizrueda/causal-audit.git
cd causal-audit
uv venv .venv --python 3.13
source .venv/bin/activate
uv pip install -e .

Quickstart

import pandas as pd
from causal_audit import RiskAwareGatekeeper

# DataFrame with a DatetimeIndex and one column per variable
df = pd.read_csv("data.csv", index_col=0, parse_dates=True)

gk = RiskAwareGatekeeper(random_seed=42)
result = gk.analyze(data=df, output_dir="results/")
print(result["policy"].decision)  # "recommend" or "abstain"
print(result["policy"].recommended_method)  # e.g. "PCMCI+" or "LPCMCI"

Run the quickstart notebook for a complete audit and its summary figure. Use the independent walkthrough to configure the audit, inspect diagnostics, and handle abstention. See Usage for the per-stage API.

The default audit does not run causal discovery. The optional exploratory graph requires include_dependency_network=True and Tigramite; it is skipped when the audit abstains.

Usage

Input: a pandas.DataFrame with a DatetimeIndex, one column per variable, NaN for missing values.

import pandas as pd
from causal_audit import AssumptionAuditor  # Stage I
from causal_audit import RiskQuantifier  # Stage II
from causal_audit import MethodRecommender  # Stage III
from causal_audit import RiskAwareGatekeeper  # Stages I → II → III

df = pd.read_csv("data.csv", index_col=0, parse_dates=True)

# Stage I — diagnostics (stationarity, irregularity, persistence, nonlinearity, confounding)
auditor = AssumptionAuditor(alpha=0.05)
evidence = auditor.audit(df)  # → AuditEvidence with per-variable effect sizes

# Stage II — diagnostic-derived risk scores with approximate uncertainty bounds
quantifier = RiskQuantifier()
risk_profile = quantifier.quantify(evidence)  # → RiskProfile (6 scores, bounds, ledger)

# Stage III — recommend a method or abstain
recommender = MethodRecommender()
policy, scorecard = recommender.recommend(risk_profile)  # → Policy + Scorecard

# Or run all three stages at once:
gk = RiskAwareGatekeeper(random_seed=42)
result = gk.analyze(data=df, output_dir="results/")
print(result["policy"].decision)  # "recommend" or "abstain"
print(result["policy"].recommended_method)  # "PCMCI+" or "LPCMCI"

Stage I can be used alone for structured assumption auditing in individual studies. Use the gatekeeper for the complete configured pipeline: per-stage defaults do not automatically load its calibration configuration or retain all downstream diagnostic inputs.

The paper evaluates four calibrated risk dimensions. The current implementation returns six scores and includes heuristic fallbacks and overrides. Its uncertainty bounds and policy confidence are not probabilities that a causal graph is correct; low confounding proxies cannot establish causal sufficiency. Investigate severe nonstationarity and re-audit any justified preprocessing before selecting a discovery method.

Framework, figures & benchmarks

The pipeline figure, the figure catalogue (six diagnostic figures plus an optional exploratory graph), the synthetic DGP atlas (F1–F10), the framework extension points, and the nonlinearity-diagnostic notes live in FRAMEWORK.md.

Reproducing paper experiments

See the step-by-step commands in FRAMEWORK.md.

Citation

@misc{ruiz2026causalaudit,
  title   = {Causal-Audit: A Framework for Risk Assessment of Assumption
             Violations in Time-Series Causal Discovery},
  author  = {Marco Ruiz and Miguel Arana-Catania and David R. Ardila
             and Rodrigo Ventura},
  year    = {2026},
  eprint  = {2604.02488},
  archivePrefix = {arXiv},
  primaryClass  = {cs.LG},
  doi     = {10.48550/arXiv.2604.02488},
  url     = {https://arxiv.org/abs/2604.02488},
}

MIT License

Metadata

Release files for causal-audit 0.3.3

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

Source distribution (sdist)

Source distribution for causal-audit 0.3.3
File Size Uploaded Provenance Actions
causal_audit-0.3.3.tar.gz 98.4 kB Without provenance Details for causal_audit-0.3.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for causal-audit 0.3.3
File Interpreter ABI Platform Actions
causal_audit-0.3.3-py3-none-any.whl Python 3 none any Details for causal_audit-0.3.3-py3-none-any.whl

Total release size: 200.6 kB

Release files / causal_audit-0.3.3.tar.gz

Download URL causal_audit-0.3.3.tar.gz
Size 98.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f3acd2e84d0ad26315f47f9505f2abdadc322bd9e48e0cea91cbf673a1474381
BLAKE2b-256 checksum
How to use checksums
9eadd14cc00ca28e859fde5b6610f90c14bfa1f47e949291c30d9d8c5844c761
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

Release files / causal_audit-0.3.3-py3-none-any.whl

Download URL causal_audit-0.3.3-py3-none-any.whl
Size 102.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0de6f8a6e159d04d94f11855f3a88824aae7507f234a4103f7f2f68ba867b260
BLAKE2b-256 checksum
How to use checksums
a8e7d1df5672598612ea093b2e413040686c9ce0aaceca7474b6a0525adf24bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

Security for causal-audit 0.3.3

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.

Release history Release notifications | RSS feed

This release

0.3.3 This release

2 release files No provenance

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