Learn R Programming

whatifbandit (version 0.3.0)

get_bandit.ucb1: UCB1 Sampling Algorithm

Description

Calculates upper confidence bounds for each treatment arm

Usage

# S3 method for ucb1
get_bandit(past_results, conditions, current_period)

Value

A named list with 2 elements: a tibble/data.table containing UCB1 and success rate for each condition, and a named numeric vector of assignment probabilities, where the highest UCB1 out of the treatments is assigned 1, and the rest 0.

Arguments

past_results

A tibble/data.table containing summary of prior periods, with successes, number of observations, and success rates, which is created by get_past_results().

current_period

Numeric value of length 1; current period of the adaptive trial simulation.