Skip to main content

Conditional Minimax Regret design rules for pilot-informed experiments

Project description

cmrdesign Python Package

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 current Python alpha from PyPI:

python -m pip install cmrdesign==0.1.0a2

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 Example

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="bounded")
print(fit.pi)
print(fit.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().
  • Appendix E pilot-planning helpers via cmr_plan().
  • Expert rectangle helpers via rectangle_*() and cmr_*_from_rectangle().

See the repository-level docs for applied guidance:

  • docs/quickstart.md
  • docs/choosing_methods.md
  • docs/methods.md
  • docs/pilot_planning.md

From the repository root, run local checks with:

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

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

cmrdesign-0.1.0a2.tar.gz (37.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cmrdesign-0.1.0a2-py3-none-any.whl (39.0 kB view details)

Uploaded Python 3

File details

Details for the file cmrdesign-0.1.0a2.tar.gz.

File metadata

  • Download URL: cmrdesign-0.1.0a2.tar.gz
  • Upload date:
  • Size: 37.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for cmrdesign-0.1.0a2.tar.gz
Algorithm Hash digest
SHA256 0478dc01b4e60ae305908a777631635993ce78bc984eaf75dcb07ba9cbbfac19
MD5 f0a6f285cca710ab4688723d17519953
BLAKE2b-256 0e1fc73e70c16cf3065a0bdad20f900bb779683c9f443ea80877f7847e0dcee0

See more details on using hashes here.

File details

Details for the file cmrdesign-0.1.0a2-py3-none-any.whl.

File metadata

  • Download URL: cmrdesign-0.1.0a2-py3-none-any.whl
  • Upload date:
  • Size: 39.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for cmrdesign-0.1.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 b8d4cc68a1448688eae66cb0a37d0601bf35af4c61e3f71922b881a6668f538d
MD5 420de91b881d305c54c6df810c99eba6
BLAKE2b-256 ea98a6be38ad96deeae9fc34c24f205de52b391c30af59cef170337fe28c9f85

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