How Do I Calculate The Evidence From Bayes Theorem

54 Views Asked by At

In Bayesian Inference, we can calculate the evidence in one of two ways:

$$P(E) = \sum_k^K P(H=k)P(E|H=k)$$

or by:

$$P(E) = \int P(H)P(E|H) dz$$

We want the probability that our coin toss is fair, given the following data:

We flip a coin 5 times, and we get heads 3 times.

Our prior distribution can simply be the standard normal distribution.

$$P(H = 0.5|E) = \frac{P(E|H = 0.5) P(H=0.5)}{P(E)}$$

$$P(H = 0.5|E) = \frac{(_5C_3 * 0.5^3 * 0.5^5)* \frac{3}{5}}{P(E)}$$

How would I calculate P(E) in this example?

$$P(E) = P(H=0.5)P(E|H = 0.5) + P(H \neq 0.5)P(E|H \neq 0.5)$$

This is my general misunderstanding with Bayesian Inference. I understand that sometimes the Evidence can be intractable to calculate, but what information would I need here to be able to actually compute the sum or the integral of the Evidence? I'm not even sure how the math for an integral over probabilities would even look.