A Python package for counterfactual estimation and simulation in causal inference scenarios. The package provides tools for researchers and practitioners to perform counterfactual analysis through both estimation and simulation approaches.
- Counterfactual Evolution (CFE) estimation
- Semi-recursive estimation
- Cross-validation for hyperparameter selection
- Classic estimators (DinM, HT)
- Feature engineering and batch processing
- Statistical moment calculation
- Multiple simulation environments:
- Belief Adoption Model (social network influence)
- Auction Model (market dynamics)
- NYC Taxi Routes (transportation patterns)
- Exercise Encouragement Program (health interventions)
- Data Center Model (resource allocation)
- Staggered rollout support
- Customizable parameters
- Parallel execution capabilities
- Combined simulation and estimation
- Built-in visualization tools
- Multi-run experiments
- Parallel processing support
Clone the repository and install in development mode:
git clone https://github.com/CausalMP/CausalMP.git
cd CausalMP
pip install -e .Install with specific components:
# Estimator only
pip install -e .[estimator]
# Simulator only
pip install -e .[simulator]
# All components
pip install -e .[all]
# Development setup
pip install -e .[dev]-
Belief Adoption Model
- Social network belief propagation
- Treatment effects on belief adoption
-
Auction Model
- Multi-bidder market dynamics
- Treatment effects on object valuations
-
NYC Taxi Routes
- Transportation network with pricing algorithm experiment
- Treatment effects on route selection
-
Exercise Encouragement Program
- Health intervention effects with social network influence
- Behavioral change dynamics
-
Data Center Model
- Distributed service system with join-the-shortest-queue routing policy
- Treatment effects on system efficiency
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you use this package in your research, please cite:
@article{shirani2025can,
title={Can We Validate Counterfactual Estimations in the Presence of General Network Interference?},
author={Shirani, Sadegh and Luo, Yuwei and Overman, William and Xiong, Ruoxuan and Bayati, Mohsen},
journal={arXiv preprint arXiv:2502.01106},
year={2025}
}
@article{shirani2024causal,
title={Causal message-passing for experiments with unknown and general network interference},
author={Shirani, Sadegh and Bayati, Mohsen},
journal={Proceedings of the National Academy of Sciences},
volume={121},
number={40},
pages={e2322232121},
year={2024},
publisher={National Academy of Sciences}
}- numpy
- pandas
- scikit-learn
- scipy
- matplotlib
- seaborn
- joblib (optional, for parallel processing)