5
$\begingroup$

Say I have two coins from a particular mint in the US.

I flip coin one 20 times and receive 4 heads, giving me a beta distribution for the bias of coin one of $Beta$($\alpha$=5, $\beta$=17).

I then flip coin two 200 times and receive 105 heads, giving me a beta distribution for coin two of $Beta$($\alpha$=106, $\beta$=96).

What I would like to calculate is (assuming a prior of $Beta$(1,1)) the probability distribution that represents the average bias of coins from that mint after flipping just the two coins (or generalizing to N coins w/ different beta distributions). There is no assumption that the coins have the same bias.

I want to know if/how this can be calculated analytically.

In case it helps, this is what I've used to answer the question via hierarchical model MCMC simulation (where mu is the parameter of interest):
Hyperpriors: k ~ $Gamma$(s=1, r= .1), mu ~ $Beta$(1, 1)
Prior: coin_bias$_i$ ~ $Beta$(mu*k,(1-mu)*k)
Likelihood: $y_i$ ~ $Binomial$(flips$_i$, heads$_i$, coin_bias$_i$)

Results from simulation

$\endgroup$
10
  • 2
    $\begingroup$ What prior distribution on the bias do you wish to assume? That seems to be essential for your approach, which appears to be Bayesian. $\endgroup$
    – whuber
    Oct 14, 2016 at 17:49
  • 1
    $\begingroup$ @whuber Thank you for helping me to clarify my question. Say the prior is a non-informative Beta, so Beta(1,1) $\endgroup$
    – Eddie
    Oct 14, 2016 at 17:50
  • 3
    $\begingroup$ OK, that helps. One more minor question: do you need to calculate or approximate the posterior distribution as a Beta or do you want the correct posterior distribution (in case the result turns out not to have a Beta distribution)? $\endgroup$
    – whuber
    Oct 14, 2016 at 17:53
  • 1
    $\begingroup$ Interesting, I did not realize the correct posterior would be something else. I would say the correct posterior if it's tractable. Otherwise an approximating Beta would do the trick. I will change the prompt to reflect your feedback. Thanks! $\endgroup$
    – Eddie
    Oct 14, 2016 at 17:57
  • $\begingroup$ If you believe the coins from the mint have the exact same $p$ wouldn't you want your prior for the second coin to be the posterior after flipping the first? $\endgroup$ Oct 15, 2016 at 2:49

1 Answer 1

1
$\begingroup$

Since you have already derived the analytic form for each individual posterior (they are each beta distributions), what you are essentially asking is how you can calculate the distribution of the mean of a set of independent beta random variables (with different parameters).

Analytically, this requires you to take convolutions of beta distributions, which does not have a nice closed form solution. For large numbers of different coins, you can appeal to the CLT to get the normal distribution as an approximate distribution of the mean bias. However, I am presuming you want results for smaller numbers of coins.

So that leaves you with simulation. Since you already know the posterior distribution, there is no reason to use a simulation method that inputs a prior and likelihood. You might as well just simulate directly from the known posteriors and average the simulations across the chains. That will give you a direct simulation of the mean bias across multiple coins.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.