draw_thompson {banditsCI} | R Documentation |
Thompson Sampling draws.
Description
Draws arms from a LinTS or non-contextual TS agent for multi-armed bandit problems.
Usage
draw_thompson(model, start, end, xs = NULL)
Arguments
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 |
Value
A list containing the drawn arms (w
) and their corresponding probabilities (ps
).
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))
[Package banditsCI version 1.0.0 Index]