# Posterior Probability and Bayesian Hypothesis testing

Let’s assume there some people in a group.

20% are from France= $P(F)$

30% are from UK

50% of french are boys= $P(B&space;|&space;F)$

30% of English are boys

Obviously If we choose a person randomly the probability of choosing a french person is 20%.

If I tell you that the chosen person is a boy, What would be the probability of the chosen to be french.

Posterior probability is a revised probability that takes into account new available information.

From the symmetry we know

$P(A\wedge&space;B)=&space;{P(B&space;\wedge&space;A)}$

$P(A|B)&space;{P(B)}=&space;{P(B&space;|&space;A)\,&space;P(A)}$

Posterior Probability $=P(A|B)&space;=&space;\frac{P(B&space;|&space;A)\,&space;P(A)}{P(B)}=&space;\frac{P(B&space;|&space;A)}{P(B)}P(A)$

We can also interpret that as

$Likelihood&space;(A&space;tohappenif&space;B)=P(A|B)&space;=&space;\frac{P(B&space;|&space;A)}{P(B)}P(A)=&space;\frac{Likelihood&space;(B&space;tohappenif&space;A)}{P(B)}P(A)$

So we can consider $\frac{P(B&space;|&space;A)}{P(B)}=&space;\frac{Likelihood&space;(B&space;tohappenif&space;A)}{P(B)}$ as the correction for prior probability  $P(A)$ which is called “Prior probability”.

as the result of the other information we have about a condition which is known to be the case.

In the example above we are interested in $P(F|B)&space;=&space;\frac{P(B&space;|&space;F)\,&space;P(F)}{P(B)}=&space;\frac{P(B&space;|&space;F)}{P(B)}P(F)=\frac{.50}{?}.20$

If we knew the total proportion of boys the answer would be easy but we don’t.

However,

$P(B)=&space;P(B&space;\wedge&space;F)+P(B&space;\wedge&space;U)+P(B&space;\wedge&space;C)$

$P(B)=&space;P(F)P(B&space;|&space;F)+P(U)&space;P(B&space;|&space;U)+P(C)&space;P(B&space;|&space;C)$

therefore even without knowing the Probability of B, if we know about B’s posterior probabilities, we can answer the question.

$P(F|B)&space;=&space;\frac{P(B&space;|&space;F)\,&space;P(F)}{P(B)}=&space;\frac{P(B&space;|&space;F)}{P(B)}P(F)=\frac{.50}{(.20*.50)(.30*.30)(.50*.25)}.20$

=================================================================================

http://en.wikipedia.org/wiki/Posterior_probability

http://en.wikipedia.org/wiki/Bayes’_theorem

Here is a nice proof for the fundamental conditional probability formula from:

http://www.dartmouth.edu/~chance/teaching_aids/books_articles/probability_book/Chapter4.pdf

Hypothesis testing for Bayes:

–We have a hypotheses H0 (null),
-We have Alternative Hypothesis H1
–We have data (Y)
–We want to check if the model that we have (H1) fits our data and doesn’t fit H0 (accept H1 / reject H0) or
our data fits (H0)  (Fail to reject H0)

Inferential statistics:

what is the probability that we can reject H0 and accept H1 at some level of significance (alpha, P)

Bayes:

We get some evidence for the model (“likelihood”) and then can even compare “likelihoods” of different models

We want to know the probability of Hypothesis to be true if Observation is observed.

$P(H0|O)&space;=&space;\frac{P(O&space;|&space;H0)\,&space;P(H0)}{P(O)}=&space;\frac{P(O&space;|&space;H0)}{P(O&space;\wedge&space;H0)+P(O&space;\wedge&space;H1)&space;}P(H0)=\frac{P(O&space;|&space;H0)}{P(O&space;|&space;H0)P(H0))+P(O&space;|H1)P(H1))&space;}P(H0)$

But what is the probability of H0 and what is the probability H1

$P(H0|O)&space;=&space;\frac{.05&space;}{(.05&space;\times&space;.5+.95\times&space;.5&space;)&space;}.5=.05$

$P(H0|O)&space;=&space;\frac{.1&space;}{(.1&space;\times&space;.5+.90\times&space;.5&space;)&space;}.5=.1$

So the classical P-Value can be interpreted as probability of H0 if O.

But

If H0 is 80% probable (or anything less than 1), while Observation has close to 0.05 chance of happening if H0

$P(H0|O)&space;=&space;\frac{.05&space;}{.05&space;\times&space;.8+.95\times&space;.2&space;)&space;}.8\approx&space;.17$

$P(H0|O)&space;=&space;\frac{.01&space;}{.01&space;\times&space;.90+.99\times&space;.1&space;)&space;}.90\approx&space;.083$

This means that if H0 is more likely then a more significant observation is necessary.

$P(H0|O)&space;=&space;\frac{.01&space;}{.01&space;\times&space;.8+.99\times&space;.2&space;)&space;}.8\approx&space;.029$

$P(H0|O)&space;=&space;\frac{.01&space;}{.01&space;\times&space;.85+.99\times&space;.15&space;)&space;}.85\approx&space;.054$

This means that if H0 is highly probable then we need a very significant observation to refute it.

If H0 is .85 probable in my mind and an observation is only 1% probable based on it, then the probability of its truth is about 5%.