Friday, May 21, 2010

Baye's Theorem

-->
Bayes theorem relates the marginal and conditional probabilities of events A and B, where B has a non-vanishing probability:
P (A/B) = P (B/A) P (A)
P (B)

Each term in the above Baye’s theorem has a conventional name:
  • P (A) is the marginal probability or prior probability of A. It is "prior" in the sense of that it does not take into account any information about B.
  • P (A|B) is the conditional probability of A, given B. It is also called the posterior probability (P) because it is derived from or depending upon the specified value of B.
  • P (B|A) is the conditional probability of B given A. It is also called the likelihood.
  • P (B) is the marginal or prior probability of B, and acts as a normalizing constant.
Let us understand this with the below example on Bayes Theorem:
Suppose there is a school with 60% boys and 40% girls as students. The female students wear trousers or skirts in equal numbers; the boys all wear trousers. An observer sees a (random) student from a distance; all the observer can see is that this student is wearing trousers. What is the probability this student is a girl? The correct answer can be computed using Bayes' theorem.
The event A is that the student observed is a girl, and the event B is that the student observed is wearing trousers. To compute P(A|B), we first need to know:
  • P(A), or the probability that the student is a girl regardless of any other information. Since the observers sees a random student, meaning that all students have the same probability of being observed, and the fraction of girls among the students is 40%, this probability equals 0.4.
  • P(B|A), or the probability of the student wearing trousers given that the student is a girl. As they are as likely to wear skirts as trousers, this is 0.5.
  • P(B), or the probability of a (randomly selected) student wearing trousers regardless of any other information. Since half of the girls and all of the boys are wearing trousers, this is 0.5×0.4 + 1×0.6 = 0.8.
Given all this information, the probability of the observer having spotted a girl given that the observed student is wearing trousers can be computed by substituting these values in the formula:
P(A|B) = \frac{P(B|A) P(A)}{P(B)} = \frac{0.5 \times 0.4}{0.8} = 0.25.


No comments:

Post a Comment