Software
I maintain open-source tools that turn econometric methods into documented, auditable research workflows. The main project is cmrdesign, an R and Python package for deciding how a pilot, staged experiment, or A/B-test ramp-up should shape the experiment that follows.
Package
cmrdesign
R package on R-universe · Python alpha on PyPI · MIT License
Give the package pilot outcomes and treatment labels; it recommends a main-wave treatment allocation and reports a finite-sample regret certificate.
R
fit <- cmr_two_arm(
y, d, alpha = 0.05, method = "auto"
)
fit$pi # main-wave share
fit$U_CMR # regret certificatePython
fit = cmr.cmr_two_arm(
y, d, alpha=0.05, method="auto"
)
fit.pi # main-wave share
fit.U_CMR # regret certificatecmrdesign implements Conditional Minimax Regret design rules from When and How to Pilot. Use it when a pilot, staged experiment, or A/B-test ramp-up contains outcomes and treatment labels, and the next task is choosing a treatment allocation for the larger main wave.
Balanced assignment ignores pilot variance information; feasible Neyman allocation can overreact to a small pilot. CMR adapts only when the pilot is informative enough. The same workflow applies to field pilots, staged experiments, and A/B tests in which a small ramp-up precedes the full experiment.
The R and Python APIs are intended to be parallel: shared JSON fixtures check common cases across languages, and separate validation scripts compare selected outputs with independent reference calculations. GitHub Actions runs the R and Python test suites, fixture checks, validation checks, and the pkgdown documentation build.
Install
Install from R or Python
R
Current release
install.packages(
"cmrdesign",
repos = c(
"https://juancyamin.r-universe.dev",
"https://cloud.r-project.org"
)
)Development version
remotes::install_github(
"juancyamin/cmrdesign",
subdir = "r"
)Current R package: R-universe.
Python
Current alpha
python -m pip install --pre cmrdesignDevelopment version
python -m pip install \
"cmrdesign @ git+https://github.com/\
juancyamin/cmrdesign.git\
#subdirectory=python"Current Python package: PyPI. The Python release is alpha while the API stabilizes.
Coverage
Which function should I use?
The applied functions estimate the uncertainty in pilot variances, solve the CMR design problem, and return allocations that can be realized as integer treatment counts for the main experiment.
| Design | Function | Main inputs |
|---|---|---|
| One treatment and one control | cmr_two_arm() | y, d |
| Raw unbounded outcomes | cmr_unbounded() | y, d, psi |
| Multiple treatments with one control | cmr_multiarm() | y, arm, control_arm |
| Known strata | cmr_stratified() | y, d, strata, strata_share |
| Multiple outcomes per unit | cmr_multiple_outcomes() | outcome matrix y, d, weights |
| Proxy or delayed primary outcome | cmr_proxy() | proxy_y, d, bridge constant zeta |
| Pilot/main-wave sample-size planning | cmr_plan() | total n, pilot SD guesses |
| Integer counts from CMR shares | realize_allocation() | a CMR result, n_main |
Interpretation
Design, not estimation
cmrdesign is a design package, not a treatment-effect estimator. Its regret certificate describes allocation risk relative to an oracle design; it is not a confidence interval for a treatment effect.
The repository contains software, examples, tests, and documentation. Paper replication code and raw empirical calibration workflows are separate from the package.
Citation
Cite the paper and software
Cite as: Yamin, J. C. (2026). When and How to Pilot: Design Rules for Two-Wave Experiments. arXiv:2607.16982. Software: cmrdesign (R and Python).
BibTeX
@misc{yamin2026pilot,
title = {When and How to Pilot:
Design Rules for Two-Wave Experiments},
author = {Yamin, Juan C.},
year = {2026},
doi = {10.48550/arXiv.2607.16982},
url = {https://arxiv.org/abs/2607.16982}
}
@manual{cmrdesign2026,
title = {cmrdesign:
Conditional Minimax Regret Design Rules},
author = {Yamin, Juan C.},
year = {2026},
note = {R and Python software},
url = {https://juancyamin.github.io/cmrdesign/}
}