In Bayesian statistics, choosing appropriate probability distributions for the prior, likelihood, and posterior is crucial for accurate inference. Here's why the Beta and Binomial distributions were selected in your analysis:
1. Likelihood: Binomial Distribution
Why Binomial?
- Bernoulli Trials: Flipping a coin is a classic example of a Bernoulli trial, where there are only two possible outcomes: heads (success) or tails (failure).
- Fixed Number of Trials: You flipped the coin a fixed number of times (100 flips), which meets one of the key criteria for a Binomial distribution.
- Independent Trials: Each coin flip is independent of the others—the outcome of one flip doesn't affect another.
- Constant Probability: The probability of getting heads (success) is the same on each flip, although we might not know its exact value.
Binomial Distribution Definition:
The Binomial distribution models the number of successes ( x ) in ( n ) independent Bernoulli trials with probability ( p ) of success on each trial. The probability mass function is:
[
P(X = x | n, p) = \binom{n}{x} p^{x} (1-p)^{n-x}
]
In your case:
- ( n = 100 ) flips
- Observed ( x = 60 ) heads
- Probability of heads ( p ) is what we're trying to estimate
2. Prior and Posterior: Beta Distribution
Why Beta?
- Conjugate Prior to Binomial: The Beta distribution is the conjugate prior for the Binomial likelihood in Bayesian analysis. This means that if the prior distribution of ( p ) is a Beta distribution and the likelihood is Binomial, the posterior distribution of ( p ) will also be a Beta distribution. This mathematical property simplifies calculations.
- Supported on [0,1]: The Beta distribution is defined on the interval [0,1], which is appropriate since ( p ) is a probability.
Beta Distribution Definition:
The Beta distribution with parameters ( \alpha ) and ( \beta ) has the probability density function:
[
f(p | \alpha, \beta) = \frac{1}{\text{B}(\alpha, \beta)} p^{\alpha - 1} (1 - p)^{\beta - 1}
]
where ( \text{B}(\alpha, \beta) ) is the Beta function, which normalizes the distribution.
Prior Beta(10,10):
- Belief in Fairness: Setting ( \alpha = \beta = 10 ) represents a prior belief that the coin is likely fair but allows for moderate variability.
- Interpretation: The prior can be thought of as having observed 20 virtual coin flips with 10 heads and 10 tails before collecting your actual data.
Updating to Posterior Beta(70,50):
- Posterior Parameters: When using a Beta prior and a Binomial likelihood, the posterior Beta distribution parameters update as follows:
[
\text{Posterior } \alpha = \alpha_{\text{prior}} + x
]
[
\text{Posterior } \beta = \beta_{\text{prior}} + n - x
]
[
\alpha_{\text{posterior}} = 10 + 60 = 70
]
[
\beta_{\text{posterior}} = 10 + 100 - 60 = 50
]
- Result: The posterior distribution is Beta(70,50), reflecting updated belief after observing the data.
3. Advantages of Using Beta and Binomial
- Analytical Tractability: The conjugate relationship allows for straightforward updating of beliefs without complex integrations.
- Interpretability: The parameters of the Beta distribution have intuitive meanings in terms of "prior successes" and "prior failures."
- Flexibility: By adjusting the parameters ( \alpha ) and ( \beta ), you can represent different degrees of prior belief strength.
4. Conclusion
Using the Beta distribution as a prior for the probability of success in a Binomial process, and updating it with Binomial likelihood data, provides a mathematically convenient and interpretable framework for Bayesian inference. It allows you to coherently update your beliefs about the probability of heads after observing the data, resulting in the posterior distribution that reflects both your prior beliefs and the observed evidence.