sim_rand_bandit: Simulate Random Bandit

Description Usage Arguments

View source: R/sim_rand_bandit.R

Description

In this function we assume that the true expectation of each lever can be expressed as linear combination of known basis functions with known coefficients.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
sim_rand_bandit(
  nsteps,
  nlevers,
  J_mod,
  J_true,
  sd,
  alpha = 1,
  alpha_true = 1,
  calc_mse = FALSE,
  b = 2
)

Arguments

nsteps

The number of steps to make in the trajectory.

nlevers

The number of levers to choose from.

J_mod

The number of basis functions to use in the model (not including) the intercept.

J_true

The number of basis functions to be used in the expression for each lever's true expectation.

sd

A vector of the standard deviations of each lever.

alpha

A scaling parameter which tunes how the prior variance decreases as J_mod increases.

alpha_true

The true scaling parameter that the coefficients are generated from.

calc_mse

True, if you want to output the mse for the beta coefficients.

b

Hyperparameter for the inverse gamma distribution. Directly related to the rate of exploration.


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