sim_post {contextual}R Documentation

Binomial Posterior Simulator

Description

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

Usage

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

Author(s)

Thomas Lotze and Markus Loecher

Examples


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


[Package contextual version 0.9.8.4 Index]