Analyzing Randomized Experiments as Multi-Arm Bandits
Calculate Adaptive AIPW Estimates
Adaptively Assign Treatments in a Period
Checks Validity of Thompson sampling probabilities
Checking For Valid Assignment Methods
Checking existence and declaration of columns
Checking for Valid Input Data
Checking Imputation Info
Check Level
Checking if Inputs are Logical Values (TRUE and FALSE)
Checking If Inputs Are Positive Integers or a Valid String
Checking for Proportions
Column arguments shared across functions
Condenses results into a list for multiple_mab_simulation()
Creating proper conditions vector
Create Treatment Wave Cutoffs
Create Necessary Columns for Multi-Arm Bandit Trial
Create Prior Periods
Ends Multi-Arm Bandit Trial
Calculates Number of Observations Assigned to Each Treatment
Calculate Multi-Arm Bandit Decision Based on Algorithm
Thompson sampling Algorithm
UCB1 Sampling Algorithm
Calculate Observation Level AIPW For Each Treatment Condition
Gather Past Results for Given Assignment Period
Precomputing Key Values for Outcome Imputation
Outcome Imputation Preparation
Imputing New Outcomes of Multi-Arm-Bandit Trial
Simulates Multi-Arm Bandit Trial From Prepared Inputs
Run Multiple Multi-Arm-Bandit Trials with Inference in Parallel
Plot Treatment Arms Over Time
Plot Cumulative Assignment Probability Over Time
Plot AIPW Estimates
Plots Histograms of multiple_mab_simulation() Results
Plots AIPW Confidence Intervals
Plot Treatment Arms Over Multiple Trials
Plot Generic for mab objects
Plot Generic For multiple.mab Objects
Pre-Simulation Setup for an adaptive Multi-Arm-Bandit Trial
Print Helper for mab and multiple.mab
Print Generic For mab
Print Generic For multiple.mab
Runs Multi-Arm Bandit Trial
Run One Adaptive Simulation With Inference.
Summary Generic For "mab" Class
Summary Generic For "multiple.mab" Class
Validates Inputs For single_mab_simulation() and `multiple_mab_simul...
Verbose Printer
whatifbandit: Analyzing Randomized Experiments as Multi-Arm Bandits
Simulates the results of completed randomized controlled trials, as if they had been conducted as adaptive Multi-Arm Bandit (MAB) trials instead. Augmented inverse probability weighted estimation (AIPW), outlined by Hadad et al. (2021) <doi:10.1073/pnas.2014602118>, is used to robustly estimate the probability of success for each treatment arm under the adaptive design. Provides customization options to simulate perfect/imperfect information, stationary/non-stationary bandits, blocked treatment assignments, along with control augmentation, and other hybrid strategies for assigning treatment arms. The methods used in simulation were inspired by Offer-Westort et al. (2021) <doi:10.1111/ajps.12597>.