NaN.

TutorialMachine LearningLast updated

Bayes Theorem[ Edit ]

Till now, we have calculated the probability of events based on the empirical( experimental ) evidence or on probabilities of other events. As we had remarked in our earlier tutorials that statistics enables us to tell a story about data, Bayesian inference is another powerful form of such story telling. It helps us to understand how our **belief **about the occurrence of an event can affect the probability of the event.

Generally, **Bayes' theorem **can be defined as:

P(A|B) = \frac{P(B|A) P(A)}{P(B)}

where A and B are two events.

- P(A|B) := likelihood of the occurrence of event A given that event B has occurred.
- P(A) := prior probability of the occurrence of event A
- P(B) := prior probability of the occurrence of event B
- P(B|A) := likelihood of the occurrence of event B given that event A has occurred.

In calculating the probability of occurrence of A given B has occurred, we have also incorporated the evidence of A and B occurring. Prior probability is the probability of the occurrence of an event without the presence of test evidence while Posterior probability accounts for the change in probability after incorporating test evidence.

Q) Let us do a simple example on spam classification. Let A denote the probability that mail is "* spam*", B denote that it is of "

P(A) = 0.7, P(B) = 0.2, P(C) = 0.1. Let K denote the likelihood that the mail contains the word "**free**". The posterior probabilities accounting the prior experience of the mails containing "**free" **can be outlined as follows:

P(K|A) = 0.9, P(K|B) = 0.01, P(K|C) = 0.01. Given that I have received a mail containing "**free", **what is the probability that it is spam?

**Ans. **We have to calculate the probability of mail being spam given that it contains the word free. Applying the **Bayesian theorem, **we get:

P(A|K) = \frac{P(K|A) P(A)}{P(K)}

Now, to calculate P(K), we need to account our experience too:

P(K) = P(K|A)P(A) + P(K|B)P(B) + P(K|C)P(C)

Calculating both the above equations, we get: P(A|K) = 0.995.

1) Bayes' theorem is a special tool to incorporate the evidence into the given probabilities to find the posterior probability.

2) Bayes rule helps us to infer more powerfully from the given probabilities.

1) Udacity

2) A Concise Course in Statistical Inference (Springer Texts in Statistics)

3) http://www.sciweavers.org/free-online-latex-equation-editor

**I would love to receive feedback in the comment section below.**

Read more…(411 words)

About the contributor:

Anirudh ThatipelliCS student interested in Statistics

100%

Loading…

Join the discussion. Add a reply…

Post

Table of contents

- Key Takeaways:
- References:

Contributor

Anirudh ThatipelliCS student interested in Statistics

100%

Ready to join our community?

Sign up below to automatically get notified of new courses, get **reminders** to finish ones you subscribe to, and **bookmark** lessons to read later.

Continue with Facebook

— OR —

Your Full Name

Email address

I have an account. Log in instead

By signing up, you agree to our Terms and our Privacy Policy.

Popular Courses

New Courses

About Us

Get in touch

Copyright 2016-18, Compose Labs Inc. All rights reserved.