Simulates the posterior distribution of the Bayesian probabilities for each arm being the best binomial bandit.

sim_post(x, n, alpha = 1, beta = 1, ndraws = 5000)

Arguments

x

Vector of the number of successes per arm.

n

Vector of the number of trials per arm.

alpha

Shape parameter alpha for the prior beta distribution.

beta

Shape parameter beta for the prior beta distribution.

ndraws

Number of random draws from the posterior.

Value

Matrix of bayesian probabilities for each arm being the best binomial bandit

Examples

x <- c(10,20,30,50) n <- c(100,102,120,130) sp <- sim_post(x,n)