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()andcmr_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_*()andcmr_*_from_rectangle().
See the repository-level docs for applied guidance:
docs/quickstart.mddocs/choosing_methods.mddocs/methods.mddocs/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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0478dc01b4e60ae305908a777631635993ce78bc984eaf75dcb07ba9cbbfac19
|
|
| MD5 |
f0a6f285cca710ab4688723d17519953
|
|
| BLAKE2b-256 |
0e1fc73e70c16cf3065a0bdad20f900bb779683c9f443ea80877f7847e0dcee0
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b8d4cc68a1448688eae66cb0a37d0601bf35af4c61e3f71922b881a6668f538d
|
|
| MD5 |
420de91b881d305c54c6df810c99eba6
|
|
| BLAKE2b-256 |
ea98a6be38ad96deeae9fc34c24f205de52b391c30af59cef170337fe28c9f85
|