Supposed I have $n$ coins and I'm interested in finding the $k < n$ coins which have the highest odds of coming up heads and I want to know $p(heads)$ for each of these $k$ coins.
Assume that I'm going to select the top $k$ coins using the maximum likelihood estimate of $p(heads)$ on a finite sample of observations (some for each coin, maybe more for some than others).
After choosing this top $k$, the maximum likelihood estimate of $p(heads)$ seems biased, because we are more likely to choose coins which just got lucky. Our final estimate of $p(heads)$ should probably shrink back towards 50/50, the mean over all the coins, or whatever else is appropriate.
Can anyone suggest a method for getting an unbiased estimate of $p(heads)$ for the coins chosen in this manner?
EDIT: This R code demonstrates the bias I'm talking about
draw = function() {
n = 100
k = 5
m = 200
probs = runif(n)
heads = rbinom(n, m, probs)
top = order(heads, decreasing=T)[1:k]
err = sum(heads[top]/m) - sum(probs[top])
return(err)
}
e = replicate(10000, draw())
hist(e)