R/value_remaining.R

Defines functions value_remaining

Documented in value_remaining

value_remaining <- function(x,
  n,
  alpha = 1,
  beta = 1,
  ndraws = 10000
 ){
   post = sim_post(x,n,alpha,beta,ndraws)
   postWin = prob_winner(post)
   iMax = which.max(postWin)
   thetaMax = apply(post,1,max)
   #value_remaining:
   vR = (thetaMax-post[,iMax])/post[,iMax]
   return(vR)
 }

Try the bandit package in your browser

Any scripts or data that you put into this service are public.

bandit documentation built on June 29, 2022, 5:05 p.m.