Analyzing Randomized Experiments Using Multi-Arm Bandits
Overview
Simulates response-adaptive experimental trials using Multi-Arm Bandits. Adaptive robust estimators defined in Hadad et al. (2021) doi:10.1073/pnas.2014602118 and Offer-Westort et al. (2021) doi:10.1111/ajps.12597 are used to robustly estimate conditional expectations and treatment effects. Provides significant simulation customization options for imperfect information, non-stationary bandits, and increased exploration strategies for assignments.
Bug Fixes
- Fixing CRAN identified bug with
data.frame,data.tableequality on NoLD R build. - For
mab_from_rct()imputations are no computed usingstats::rbinom()with appropriate probabilities instead ofrandomizr::block_ra(). This new approach increases the variance of the imputations, but was a planned change to support custom imputation functions in the future. - Ensuring probabilities of assignment are split evenly under UCB1 ties (
bandit.RLine 412-417), instead of relying on a later implicit normalization. This ensures the intended effect withcontrol_augmentandrandom_assign_prop - In
simulate_mab(),furrr::furrr_options()is now called with the appropraitefurrr_argsobject instead of..., which also contains arguments for the user specifictime_model.
Other
Show all changes in 1.0.3Hide the rest of the changes in 1.0.3
- Introductory vignette updated for 1.x.x release, along with 2 new vignettes planned.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
- WARNING12 OK, 1 WARNING2026-06-08
- OK14 OK2026-03-10
Documentation
- Help pages
- 46 (42 internal)includes a package overview page
- Examples that run
- 100%3 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 15%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 4
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
Commits over time
7 development-tooling and community-health practices detected across 5 families in the upstream repository
Checks run against github.com/noch05/whatifbandit on 2026-10-21.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Show all practicesHide 1 practice
Dependencies
Installing whatifbandit adds 41 packages (23 with compiled code, 34 MB of source tarballs). Heaviest: stringi 11 MB, data.table 5.7 MB, Rcpp 1.8 MB.
Code & Tests
Datasets
People & History
Pick two releases to compare their code metrics.
- unarchivedReturned to CRAN2026-08-24
- 1.0.3Latest
- archivedRemoved from CRAN2026-08-22issues were not corrected in time
- 1.0.22026-07-23 · diff ↗ ·
removed 2 exports
multiple_mab_simulation, single_mab_simulationadded 3 exports
joint_test, mab_from_rct, simulate_mab - RR 4.6.0 released · 2026-04-24
- 0.3.02025-11-03
- RR 4.5.0 released · 2025-04-11
Package metadata
- First published
- 2025-11-03
- Total releases
- 3 / 1 yrs
- License
- GPL (>= 3) OSI
- Minimum R
- ≥ 4.1.0
- Bundled data
- 100 KB / 1 file
- Download size
- 1.1 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("whatifbandit")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.