
Wei's (1977, 1978) Adaptive Urn Sequential Design, UD(\(\alpha\), \(\beta\))
Source:R/design_seq_one_by_one_urn.R
DesignSeqOneByOneUrn.RdA DesignSeqOneByOne implementing Wei's
adaptive biased-coin urn design \(UD(\alpha, \beta)\): conceptually, an urn starts
with \(\alpha\) balls of each type (treatment and control), and each assignment
is drawn proportionally to the current ball counts, then \(\beta\) balls of the
opposite type to whatever was drawn are added back to the urn (so drawing
treatment adds \(\beta\) control balls, and vice versa), pushing subsequent draws
toward the under-represented arm. No covariates are used; only the running
treated/control counts \(n_T\), \(n_C\) matter, via the closed-form assignment
probability
$$\Pr(w_t = 1) = \frac{\alpha + \beta \, n_C}{2\alpha + \beta (n_T + n_C)}.$$
Like DesignSeqOneByOneEfron, this design
balances running assignment counts online while remaining strictly randomized (the
probability is always strictly between 0 and 1 for finite \(\alpha, \beta > 0\));
unlike Efron's design (which only distinguishes "balanced" vs. "imbalanced" and
applies a single fixed weighted_coin_prob in the imbalanced case), the urn
design's bias toward the under-represented arm scales continuously and smoothly with
the current degree of imbalance, tuned by the ratio \(\beta/\alpha\): larger
\(\beta/\alpha\) yields stronger balancing pressure, and \(\beta = 0\) recovers a
fixed \(\mathrm{Bernoulli}(0.5)\) coin (no adaptation at all).
References
Wei, L. J. (1977). "A class of designs for sequential clinical trials." Journal of the American Statistical Association, 72(358), 382-386, doi:10.1080/01621459.1977.10481006 ; Wei, L. J. (1978). "The adaptive biased coin design for sequential experiments." The Annals of Statistics, 6(1), 92-100, doi:10.1214/aos/1176344068 . See also randomized experiment for orientation on adaptive biased-coin sequential designs.
Super classes
Design -> DesignSeqOneByOne -> DesignSeqOneByOneUrn
Methods
+ inherited public methods from DesignSeqOneByOne
+ inherited public methods from Design
Design$add_all_subject_responses()Design$add_one_subject_response()Design$any_censoring()Design$applicable_inference_class_names()Design$assert_all_responses_recorded()Design$assert_all_subjects_arrived()Design$assert_even_allocation()Design$assert_fixed_sample()Design$capabilities()Design$check_experiment_completed()Design$draw_ws_according_to_design()Design$duplicate()Design$get_X()Design$get_X_imp()Design$get_X_raw()Design$get_design_formula()Design$get_edi_version_created()Design$get_effective_dead()Design$get_effective_time()Design$get_missingness_method()Design$get_n()Design$get_ordinal_levels()Design$get_original_ordinal_levels()Design$get_prob_T()Design$get_response_type()Design$get_response_type_original()Design$get_t()Design$get_w()Design$get_y()Design$get_y_L()Design$get_y_R()Design$get_y_original()Design$has_general_censoring()Design$incompatible_inference_classes_due_to_design_structure()Design$is_a_bernoulli_capable()Design$is_a_cluster_capable()Design$is_a_kk_matching_capable()Design$is_blocking_design()Design$is_fixed_sample_size()Design$is_matching_design()Design$overwrite_all_subject_assignments()Design$prepare_for_resampling_replay()Design$randomization_family()Design$supports()Design$supports_randomization_draw()Design$supports_resampling()Design$supports_resampling_replay()Design$transform_y()Design$unavailable_inference_classes_due_to_missing_packages()Design$warm_all_subject_data_cache()
DesignSeqOneByOneUrn$new()
Initialize Wei's UD(\(\alpha\), \(\beta\)) adaptive urn sequential experimental design (see class documentation for the exact assignment-probability formula).
Usage
DesignSeqOneByOneUrn$new(
alpha = 1,
beta = 1,
response_type,
include_is_missing_as_a_new_feature = TRUE,
n = NULL,
verbose = FALSE,
missingness_method = "impute",
design_formula = ~.,
seed = NULL
)Arguments
alphaThe initial number of balls of each type (Treatment/Control) in the conceptual urn; larger
alpharelative tobetaweakens the balancing effect (assignment probabilities stay closer to 0.5 for longer).betaThe number of balls of the opposite type added to the urn after each assignment;
beta = 0recovers an unbiased \(\mathrm{Bernoulli}(0.5)\) coin (no balancing).response_typeThe data type of response values.
include_is_missing_as_a_new_featureFlag for missingness indicators.
nThe sample size.
verboseA flag for verbosity.
missingness_methodHow to handle missing values in covariates.
design_formulaA formula object.
seedInteger seed for reproducibility.
DesignSeqOneByOneUrn$assign_wt()
Draw the next subject's treatment assignment from Wei's UD(\(\alpha\), \(\beta\)) urn probability (see class documentation), computed from the running treated/control counts.
Examples
seq_des = DesignSeqOneByOneUrn$new(n = 6, response_type = 'continuous')
seq_des$add_one_subject_to_experiment_and_assign(data.frame(x1 = rnorm(1)))
#> [1] 1