Draws arms from a LinTS or non-contextual TS agent for multi-armed bandit problems.
Arguments
- model
List. Contains the parameters of the model, generated by
LinTSModel()
.- start
Integer. Starting index of observations for which arms are to be drawn. Must be a positive integer.
- end
Integer. Ending index of the observations for which arms are to be drawn. Must be an integer greater than or equal to
start
.- xs
Optional matrix. Covariates of shape
[A, p]
, wherep
is the number of features, if the LinTSModel is contextual. Default isNULL
. Must not contain NA values.
Examples
set.seed(123)
model <- LinTSModel(K = 5, p = 3, floor_start = 1/5, floor_decay = 0.9, num_mc = 100,
is_contextual = TRUE)
draws <- draw_thompson(model = model, start = 1, end = 10,
xs = matrix(rnorm(30), ncol = 3))