CausalBoundingEngine Documentation
CausalBoundingEngine is a modular Python package for comparing and applying causal bounding algorithms. It provides a unified interface for computing bounds on causal effects in scenarios with unmeasured confounding.
Quick Start
Install the package:
pip install causalboundingengine
Basic usage:
import numpy as np
from causalboundingengine.scenarios import BinaryConf
# Your data
X = np.array([0, 1, 1, 0, 1]) # Treatment
Y = np.array([1, 0, 1, 0, 1]) # Outcome
# Create scenario and compute bounds
scenario = BinaryConf(X, Y)
ate_bounds = scenario.ATE.manski() # (-1.0, 1.0)
pns_bounds = scenario.PNS.tianpearl() # (0.0, 0.8)
Features
Multiple Algorithms: Manski, Tian-Pearl, Causaloptim, Autobound, ZhangBareinboim, Zaffalonbounds, and more
Unified Interface: Consistent API across all algorithms and scenarios
Multiple Scenarios: Support for confounded and instrumental variable settings
External Engine Support: Integration with R (via rpy2) and Java (via jpype1)
Extensible Design: Easy to add new algorithms and scenarios
Note
Attribution: CausalBoundingEngine integrates algorithms from multiple published research papers. Please see the References and Credits section for complete citations and attribution when using this library in your research.
Contents:
- Installation
- Quick Start Guide
- Basic Workflow
- Example 1: Simple Confounded Setting
- Example 2: Instrumental Variable Setting
- Example 3: Algorithm Parameters
- Example 4: R-based Algorithms
- Example 5: Java-based Algorithms
- Example 6: Probability of Necessity and Sufficiency (PNS)
- Working with Real Data
- Comparing Multiple Algorithms
- Next Steps
- Common Patterns
- Core Concepts
- Algorithms Reference
- Scenarios Reference
- Extending CausalBoundingEngine
- API Reference
- Examples
- References and Credits
- Contributing