Skip to main content

cmrdesign Python Package

PyPI Python versions arXiv

Python implementation of cmrdesign, the applied Conditional Minimax Regret design-rule package.

The methods accompany When and How to Pilot: Design Rules for Two-Wave Experiments by Juan C. Yamin. This package is implementation-focused and uses simulated examples only; paper replications and empirical simulations are intentionally kept out of the package repository.

Installation

Install the Python package from PyPI:

python -m pip install cmrdesign

For exact reproducibility, pin the release version:

python -m pip install cmrdesign==0.1.0

For the development version from GitHub:

python -m pip install "cmrdesign @ git+https://github.com/juancyamin/cmrdesign.git#subdirectory=python"

For local development from the repository root:

python -m pip install -e python

Quick Start

import numpy as np
import cmrdesign as cmr

rng = np.random.default_rng(123)
d = np.r_[np.ones(40), np.zeros(40)]
y = np.r_[rng.beta(2, 5, 40), rng.beta(4, 4, 40)]

fit = cmr.cmr_two_arm(y, d, alpha=0.05, method="auto")
print(fit.pi)
print(fit.U_CMR)

allocation = cmr.realize_allocation(fit, n_main=1000)
print(allocation.counts)
print(allocation.realized_U_CMR)

Implemented Surface

  • cmr_two_arm() and cmr_binary().
  • method="auto" for the applied bounded/binary default.
  • Maurer–Pontil bounded-outcome variance rectangles.
  • Exact Bernoulli folded-binomial variance rectangles.
  • Martinez-Taboada–Ramdas (MTR) bounded-outcome rectangles.
  • Two-arm unbounded-outcome median-of-means rectangles via cmr_unbounded().
  • Shared-control multi-arm CMR via cmr_multiarm().
  • Stratified CMR via cmr_stratified().
  • Multiple-outcome CMR for weighted-index and co-primary workflows via cmr_multiple_outcomes().
  • Proxy/delayed-outcome CMR bridge widening via cmr_proxy().
  • Pilot-planning helpers from Appendix E of the accompanying paper (Yamin 2026) via cmr_plan().
  • Integer main-wave counts from CMR shares via realize_allocation().
  • Expert rectangle helpers via rectangle_*() and cmr_*_from_rectangle().

See the repository-level docs for applied guidance:

From the repository root, run local checks with:

python -m pip install -e python
python -m unittest discover -s python/tests -v

Metadata

Release files for cmrdesign 0.1.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 cmrdesign 0.1.0
File Size Uploaded Provenance
cmrdesign-0.1.0.tar.gz 47.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cmrdesign 0.1.0
File Interpreter ABI Platform
cmrdesign-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 92.5 kB

Release files / cmrdesign-0.1.0.tar.gz

Download URL cmrdesign-0.1.0.tar.gz
Size 47.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f116c0f79fab38e1dad4cd2fd1fabc50065aefcef144e5030eecb7a2aa173a6d
BLAKE2b-256 checksum
How to use checksums
5fb63c27008ee0246e0984ce712bb3ff0acc34c7d6491f03c60138e9a4864c84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / cmrdesign-0.1.0-py3-none-any.whl

Download URL cmrdesign-0.1.0-py3-none-any.whl
Size 45.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
722988ab3f4ac0c5f612a9593b75072ba76b45bcac9d72512aee8495db2b60f2
BLAKE2b-256 checksum
How to use checksums
d7a88bbec1012ab2f947d30b95afe33b0a25ac8188f2b257b1e167b7bfbe5917
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Security for cmrdesign 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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