plot_bandit_posterior: plot_bandit_posterior

Description Usage Arguments See Also Examples

View source: R/bandit_posterior.R

Description

Generates a plot that shows the bandit posterior values as they are sequentially updated by the provided win / loss data.

Usage

1
2
3
4
5
plot_bandit_posterior(
  data,
  prior = c(m1_good = 0.5, m2_good = 0.5),
  win_probs = c(good = 1/2, bad = 1/3)
)

Arguments

data

data frame containing win loss data

prior

prior vector containing the probabilities of Machine 1 and Machine 2 being good, defaults to 50-50.

win_probs

vector containing the probabilities of winning on the good and bad machine respectively.

See Also

bandit_sim to generate data to use below

Examples

1
2
3
4
# capture data from the `shiny` app `bandit_sim`.
data = data.frame(machine = c(1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L), 
                  outcome = c("W", "L", "W", "L", "L", "W", "L", "L", "L", "W"))
plot_bandit_posterior(data)

statsr documentation built on Jan. 23, 2021, 1:05 a.m.