Skip to main content

Dual bounds for model-agnostic inference

Project description

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}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dualbounds-2.0.0.tar.gz (76.3 kB view details)

Uploaded Source

File details

Details for the file dualbounds-2.0.0.tar.gz.

File metadata

  • Download URL: dualbounds-2.0.0.tar.gz
  • Upload date:
  • Size: 76.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.2

File hashes

Hashes for dualbounds-2.0.0.tar.gz
Algorithm Hash digest
SHA256 73a871861e7e91771348beb1a41d7c248030f4f337fb9ce12dc6aaaea7b3b761
MD5 0870d505fa5a48d35962f6eb278ebc76
BLAKE2b-256 772a920abd20e261373570fac14c5300b31b1db4a13878cc84d85547e99b5c57

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page