View source: R/experiment_utils.R
draw_thompson | R Documentation |
Draws arms from a LinTS or non-contextual TS agent for multi-armed bandit problems.
draw_thompson(model, start, end, xs = NULL)
model |
List. Contains the parameters of the model, generated by |
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 |
xs |
Optional matrix. Covariates of shape |
A list containing the drawn arms (w
) and their corresponding probabilities (ps
).
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.