Metadata-Version: 2.4
Name: cmrdesign
Version: 0.1.0a2
Summary: Conditional Minimax Regret design rules for pilot-informed experiments
Project-URL: Homepage, https://github.com/juancyamin/cmrdesign
Project-URL: Repository, https://github.com/juancyamin/cmrdesign
Project-URL: Issues, https://github.com/juancyamin/cmrdesign/issues
Project-URL: Documentation, https://github.com/juancyamin/cmrdesign/tree/main/docs
Project-URL: Changelog, https://github.com/juancyamin/cmrdesign/blob/main/CHANGELOG.md
Project-URL: Paper, https://arxiv.org/abs/2607.16982
Author-email: Juan Yamin Silva <juan_yamin_silva@brown.edu>
License-Expression: MIT
License-File: LICENSE
Keywords: conditional-minimax-regret,experimental-design,pilot-studies,randomized-experiments,treatment-assignment
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.10
Requires-Dist: numpy
Provides-Extra: dev
Requires-Dist: build; extra == 'dev'
Requires-Dist: hatchling; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Provides-Extra: release
Requires-Dist: build; extra == 'release'
Requires-Dist: hatchling; extra == 'release'
Requires-Dist: twine; extra == 'release'
Description-Content-Type: text/markdown

# 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](https://arxiv.org/abs/2607.16982)
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:

```bash
python -m pip install cmrdesign==0.1.0a2
```

For the development version from GitHub:

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

For local development from the repository root:

```bash
python -m pip install -e python
```

## Quick Example

```python
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:

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