multiplying beta distributions

Beta distributions seem like a cool way to keep track of how biased you think coins are. And if you want to flip multiple coins simultaneously, it seems fine to calculate the probability of getting all heads by multiplying together the means of the beta distributions for each coin.

Of course, that will just give you a number: the probability of getting all heads. But we actually know more than that. Because each coin is a beta distribution, there is some distribution over how likely it is that all the coins will land on heads.

Intuitively, it seems like we should be able to get this distribution by multiply the beta distributions for each coin together somehow. But how?

As far as I can tell, it is "hard". There's no nice formula for it. But these people came up with a nice approximation, which they use in their "subjective logic" system.

I implemented a test of this in javascript, and you can see above a demo of multiplying together three beta distributions. Note that it is showing an inverse cdf of the result. This is not because I like inverse cdfs more than pdfs (though I do), but rather because the calculation was easier that way (which is part of why I like inverse cdfs more than pdfs).

The red curve is the "real" result. This is approximated numerically using lots of integration. The blue curve is the approximation using subjective logic. Note that they are not the same. This difference appears to be real, as opposed to an insufficient numerical approximation. In fact, as far as I can gather, the real result is not really a beta distribution at all, though it is very close to one.

No comments:

Post a Comment