Skip to contents

Creates a linear Thompson Sampling model for multi-armed bandit problems.

Usage

LinTSModel(
  K,
  p = NULL,
  floor_start,
  floor_decay,
  num_mc = 100,
  is_contextual = TRUE
)

Arguments

K

Integer. Number of arms. Must be a positive integer.

p

Integer. Dimension of the contextual vector, if is_contextual is set to TRUE. Otherwise, p is ignored. Must be a positive integer.

floor_start

Numeric. Specifies the initial value for the assignment probability floor. It ensures that at the start of the process, no assignment probability falls below this threshold. Must be a positive number.

floor_decay

Numeric. Decay rate of the floor. The floor decays with the number of observations in the experiment such that at each point in time, the applied floor is: floor_start/(s^{floor_decay}), where s is the starting index for a batched experiment, or the observation index for an online experiment. Must be a number between 0 and 1 (inclusive).

num_mc

Integer. Number of Monte Carlo simulations used to approximate the expected reward. Must be a positive integer. Default is 100.

is_contextual

Logical. Indicates whether the problem is contextual or not. Default is TRUE.

Value

A list containing the parameters of the LinTSModel.

Examples

model <- LinTSModel(K = 5, p = 3, floor_start = 1/5, floor_decay = 0.9, num_mc = 100,
                    is_contextual = TRUE)