rand_thompson: Simulate Bandit Problem (Thompson Sampling)

Description Usage Arguments Value

View source: R/RcppExports.R

Description

This function is not intended to be used on its own. Instead, use the higher level function 'sim_rand_bandit()'.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
rand_thompson(
  nsteps,
  posteriors,
  basis,
  sd,
  J_mod,
  J_true,
  beta_true,
  calc_mse
)

Arguments

nsteps

The number of steps in the trajectory.

posteriors

Posterior distributions must be passed as a single list, containing elements which are lists associated with each posterior distribution i.e. a list of lists. Each posterior distribution must contain "beta","covar","a","b". NOTE: EVEN IF THERE IS JUST ONE ELEMENT, THE INPUT MUST BE A LIST OF LISTS!

basis

A list of basis functions.

sd

A vector containing the standard deviation for each lever.

J_mod

The number of basis functions to use in the model (INCLUDING THE INTERCEPT).

J_true

The number of basis functions to use in thE TRUE expected reward functions (INCLUDING THE INTERCEPT).

beta_true

A matrix, where each row is a set of coefficients used to compute the true expected reward of each lever.

Value

An object of the S4 class "bandit".


dfcorbin/npbanditC documentation built on March 23, 2020, 5:25 a.m.