Learn R Programming

whatifbandit (version 0.3.0)

create_prior: Create Prior Periods

Description

Used during run_mab_trial() to create a vector of prior periods dynamically based on the specified number of prior periods.

Usage

create_prior(prior_periods, current_period)

Value

Numeric vector containing the prior treatment periods to be used when aggregating the results for the current treatment assignment period.

Arguments

prior_periods

A numeric value of length 1, or the character string "All"; number of previous periods to use in the treatment assignment model. This is used to implement the stationary/non-stationary bandit. For example, a non-stationary bandit assumes the true probability of success for each treatment changes over time, so to account for that, not all prior data should be used when making decisions because it could be "out of date".

current_period

The current period of the simulation. Defined by loop structure inside run_mab_trial().

See Also

  • run_mab_trial()