Skip to main content

A python implementation of the dual bounds framework for inference on partially identified estimands (and the solutions to optimization problems more generally). See https://dualbounds.readthedocs.io/en/latest/ for detailed documentation and tutorials.

Installation

To install dualbounds, just use pip:

pip install dualbounds

Documentation

Documentation and tutorials are available at https://dualbounds.readthedocs.io/en/latest/.

Quickstart

Given a response vector y, binary treatment vector W, covariate matrix X, and an (optional) propensity score vector pis, dualbounds allows analysts to perform inference on partially identified estimands of the form E[f(Y(0), Y(1), X)], for any choice of f. For example, the code below shows how to perform inference on P(Y(0) < Y(1)), the proportion of individuals who benefit from the treatment. Dual bounds can wrap on top of any machine learning model to provide provably valid confidence intervals in randomized experiments.

	import dualbounds as db
	from dualbounds.generic import DualBounds

	# Generate synthetic data
	data = db.gen_data.gen_regression_data(n=900, p=30, sample_seed=123)

	# Initialize dual bounds object
	dbnd = DualBounds(
	    f=lambda y0, y1, x: y0 < y1,
	    covariates=data['X'],
	    treatment=data['W'],
	    outcome=data['y'],
	    propensities=data['pis'],
	    outcome_model='ridge',
	)

	# Compute dual bounds and observe output
	results = dbnd.fit(alpha=0.05).results()


Reference

If you use dualbounds in an academic publication, please consider citing Ji, Lei, and Spector (2023). The bibtex is below:

@misc{ji2023modelagnostic,
      title={Model-Agnostic Covariate-Assisted Inference on Partially Identified Causal Effects}, 
      author={Wenlong Ji and Lihua Lei and Asher Spector},
      year={2023},
      eprint={2310.08115},
      archivePrefix={arXiv},
      primaryClass={econ.EM}
}

Release files for dualbounds 2.0.0

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

Source distribution (sdist)

Source distribution for dualbounds 2.0.0
File Size Uploaded
dualbounds-2.0.0.tar.gz 76.3 kB Details

Release files / dualbounds-2.0.0.tar.gz

Download URL dualbounds-2.0.0.tar.gz
Size 76.3 kB
Tags Source
SHA-256 checksum
How to use checksums
73a871861e7e91771348beb1a41d7c248030f4f337fb9ce12dc6aaaea7b3b761
BLAKE2b-256 checksum
How to use checksums
772a920abd20e261373570fac14c5300b31b1db4a13878cc84d85547e99b5c57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.2

Release history Release notifications | RSS feed

This release

2.0.0 This release

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.0

1 release file

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