# Simulation and Analysis of Contextual Multi-Armed Bandit Policies

## Documentation for package ‘contextual’ version 0.9.8.4

- DESCRIPTION file.
- User guides, package vignettes and other documentation.
- Code demos. Use demo() to run them.

## Help Pages

A B C D E F G H I L M O P Q R S T U V W

## -- A --

Agent | Agent
agent | Agent
arms | Plot
average | Plot

## -- B --

Bandit | Bandit: Superclass
bandit | Bandit: Superclass
BasicBernoulliBandit | Bandit: BasicBernoulliBandit
BasicGaussianBandit | Bandit: BasicGaussianBandit
BootstrapTSPolicy | Policy: Thompson sampling with the online bootstrap

## -- C --

check_history_data | Plot
clear_data_table | History
clipr | Clip vectors
ContextualBernoulliBandit | Bandit: Naive Contextual Bernouilli Bandit
ContextualBinaryBandit | Bandit: ContextualBinaryBandit
ContextualEpochGreedyPolicy | Policy: A Time and Space Efficient Algorithm for Contextual Linear Bandits
ContextualEpsilonGreedyPolicy | Policy: ContextualEpsilonGreedyPolicy with unique linear models
ContextualHybridBandit | Bandit: ContextualHybridBandit
ContextualLinearBandit | Bandit: ContextualLinearBandit
ContextualLinTSPolicy | Policy: Linear Thompson Sampling with unique linear models
ContextualLogitBandit | Bandit: ContextualLogitBandit
ContextualLogitBTSPolicy | Policy: ContextualLogitBTSPolicy
ContextualPrecachingBandit | Bandit: ContextualPrecachingBandit
ContextualTSProbitPolicy | Policy: ContextualTSProbitPolicy
ContextualWheelBandit | Bandit: ContextualWheelBandit
ContinuumBandit | Bandit: ContinuumBandit
cumulative | History

## -- D --

data_table_factors_to_numeric | Convert all factor columns in data.table to numeric
dec<- | Decrement
dinvgamma | The Inverse Gamma Distribution
do_plot | Plot
do_step | Agent

## -- E --

EpsilonFirstPolicy | Policy: Epsilon First
EpsilonGreedyPolicy | Policy: Epsilon Greedy
Exp3Policy | Policy: Exp3

## -- F --

FixedPolicy | Policy: Fixed Arm
formatted_difftime | Format difftime objects

## -- G --

generate_bandit_data | Bandit: Superclass
get_action | Policy: Superclass
get_arm_context | Return context vector of an arm
get_context | Bandit: Superclass
get_data_frame | History
get_data_table | History
get_full_context | Get full context matrix over all arms
get_global_seed | Lookup .Random.seed in global environment
get_t | Agent
gg_color_hue | Plot
gittinsbrezzilai | Policy: Gittins Approximation algorithm for choosing arms in a MAB problem.
GittinsBrezziLaiPolicy | Policy: Gittins Approximation algorithm for choosing arms in a MAB problem.
GradientPolicy | Policy: Gradient

## -- H --

History | History

## -- I --

inc<- | Increment
ind | On-the-fly indicator function for use in formulae
initialize_theta | Policy: Superclass
inv | Inverse from Choleski (or QR) Decomposition.
invgamma | The Inverse Gamma Distribution
invlogit | Inverse Logit Function
is_rstudio | Check if in RStudio

## -- L --

LifPolicy | Policy: Continuum Bandit Policy with Lock-in Feedback
LinUCBDisjointOptimizedPolicy | Policy: LinUCB with unique linear models
LinUCBDisjointPolicy | Policy: LinUCB with unique linear models
LinUCBGeneralPolicy | Policy: LinUCB with unique linear models
LinUCBHybridOptimizedPolicy | Policy: LinUCB with hybrid linear models
LinUCBHybridPolicy | Policy: LinUCB with hybrid linear models
load | History

## -- M --

mvrnorm | Simulate from a Multivariate Normal Distribution

## -- O --

OfflineBootstrappedReplayBandit | Bandit: Offline Bootstrapped Replay
OfflineDirectMethodBandit | Bandit: Offline Direct Methods
OfflineDoublyRobustBandit | Bandit: Offline Doubly Robust
OfflineLookupReplayEvaluatorBandit | Bandit: Offline Replay with lookup tables
OfflinePropensityWeightingBandit | Bandit: Offline Propensity Weighted Replay
OfflineReplayEvaluatorBandit | Bandit: Offline Replay
ones_in_zeroes | A vector of zeroes and ones
one_hot | One Hot Encoding of data.table columns
optimal | Plot
OraclePolicy | Policy: Oracle

## -- P --

pinvgamma | The Inverse Gamma Distribution
Plot | Plot
plot.History | Plot Method for Contextual History
plot.history | Plot Method for Contextual History
Policy | Policy: Superclass
policy | Policy: Superclass
post_initialization | Bandit: Superclass
print.History | Print Method for Contextual History
print.history | Print Method for Contextual History
print_data | History
prob_winner | Binomial Win Probability

## -- Q --

qinvgamma | The Inverse Gamma Distribution

## -- R --

RandomPolicy | Policy: Random
rinvgamma | The Inverse Gamma Distribution
run | Simulator

## -- S --

sample_one_of | Sample one element from vector or list
save | History
set_data_frame | History
set_data_table | History
set_external | Change Default Graphing Device from RStudio
set_global_seed | Set .Random.seed to a pre-saved value
set_parameters | Policy: Superclass
set_reward | Policy: Superclass
set_t | Agent
sherman_morrisson | Sherman-Morrisson inverse
Simulator | Simulator
simulator | Simulator
sim_post | Binomial Posterior Simulator
SoftmaxPolicy | Policy: Softmax
summary.History | Summary Method for Contextual History
summary.history | Summary Method for Contextual History
sum_of | Sum of list

## -- T --

theta | Policy: Superclass
ThompsonSamplingPolicy | Policy: Thompson Sampling

## -- U --

UCB1Policy | Policy: UCB1
UCB2Policy | Policy: UCB2

## -- V --

value_remaining | Potential Value Remaining
var_welford | Welford's variance

## -- W --

which_max_list | Get maximum value in list
which_max_tied | Get maximum value randomly breaking ties