Skip to contents

Simulate a Bayesian Bandit choice for a given set of probabilities and a number of points for multiple games

Usage

ov_simulate_multiple_setter_distribution(
  list_dv,
  play_phase = c("Reception", "Transition"),
  n_sim = 500,
  priors = list(name = "beta", par1 = 1, par2 = 1),
  epsilon = 1,
  filter_sim = FALSE,
  attack_options = "use_data",
  setter_position_by = "rotation",
  history_table = NULL,
  attack_by = "code",
  exclude_attacks = c("PR"),
  rotation = "SHM",
  shiny_progress = NULL
)

Arguments

list_dv

list: list of datavolley object as returned by datavolley::dv_read()

play_phase

character: one or both of "Reception", "Transition"

n_sim

integer: number of simulations

priors

numeric: prior distribution of the kill rate for the different attacking options

epsilon

numeric: reward size

filter_sim

logical:

attack_options

string: either "use_data" or "use_history"

setter_position_by

string: either "rotation" or "front_back"

history_table

list: (only if attack_options is "use_history") the object returned by ov_create_history_table()

attack_by

string: either "code", "zone", "tempo", "setter call", "attacker_name", "player_role"

exclude_attacks

character: vector of attack codes to exclude

rotation

string: (only relevant when attack_by is "player_role") either "SHM" (assume a setter-hitter-middle rotation order), or "SMH" (setter-middle-hitter)

shiny_progress

numeric: an optional two-element vector. If not NULL or NA, shiny::setProgress() calls will be made during simulation with values in this range

Examples

list_dv <- list(dv_read(ovdata_example("190301_kats_beds")))
system.time({
  mssd <- ov_simulate_multiple_setter_distribution(list_dv = list_dv, play_phase = "Reception",
               n_sim = 100, setter_position_by = "front_back")
})
#>    user  system elapsed 
#>   2.685   0.000   2.685