Antecedent¶
Antecedent is an identification-first causal inference engine for Python and Rust. It takes an analysis from causal structure through estimation, diagnostics, interventions, and counterfactuals — without silently treating discovered graphs as ground truth.
Three rules are enforced throughout:
- identification is evaluated before estimation;
- priors and parametric assumptions do not upgrade nonparametric identification;
- uncertainty about causal structure is retained rather than silently resolved.
What you would use it for¶
- Estimate an effect you can defend.
analyze()checks identification first, reports the strategy and adjustment set it used, and runs refuters against the estimate by default. - Work with discovered structure honestly. Discovery returns equivalence classes and graph posteriors, not a single guessed DAG. Estimation refuses to run on an unreviewed partial graph; the Bayesian path reports how much posterior mass sits on structures where the effect is unidentified.
- Analyze temporal systems. Temporal graphs with lagged edges, PCMCI-family
discovery, pulse and sustained interventions, temporal mediation, and
incremental
CausalStatefor online workflows. - Go past effect estimates. Interventional sampling, counterfactuals, root-cause and distribution-change attribution, sensitivity analysis, and experimental-design ranking, all in the same engine.
Getting started¶
pip install antecedent, then start from the runnable examples in the
project README — each is a
single paste-and-run block with its real output shown. The Rust entry point is
CausalAnalysis::builder() in the antecedent crate.
Guides¶
| Doc | Contents |
|---|---|
| Capabilities | Full inventory: graphs, discovery, identification, estimation, validation, design |
| Comparison | Antecedent vs. DoWhy, EconML, Tigramite, causal-learn — and when to use each |
| Architecture | Invariants, crates, analysis pipeline, execution model |
| Development | CI vs local gates, tests, performance rules, versions |
| Artifacts | Wire format, migration, graph interchange |
| Prior bank | External prior catalog, compose, conflict, transport |
| API naming | Rust ↔ Python capability dictionary |
| Hot paths | Benches, baselines, allocation contracts |
| Conformance | Generated from conformance/ fixtures |
| Security review | Unsafe, deps, licensing evidence |
API reference¶
- Python: Python API on this site (
/python/via pdoc; no download) - Rust: docs.rs/antecedent; locally
cargo doc -p antecedent --open
Decisions: see adr/ in the repository.
Regenerate conformance pages:
python3 scripts/generate_conformance_docs.py