ScholarQuill logoScholarQuillUniversity Notes
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
Study Tools
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
Contact
ScholarQuill logo
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
ScholarQuill logoScholarQuillUniversity Notes
Study PortalMS-251Bayes Rule
Ctrl + K
Login
Explore
Search
Semester
Papers
CGPA
    MS-251

    Probability and Statistics

    Progress0 / 36 done
    Topics36
    1Statistics and Data Analysis2Statistical Inference3Samples, Populations, and the Role of Probability4Sampling Procedures5Discrete and Continuous Data6Statistical Modeling7Types of Statistical Studies
    8Sample Space, Events, Counting Sample Points9Probability of an Event10Additive Rules11Conditional Probability12Independence and the Product Rule13Bayes’ Rule14Random Variables and Probability Distributions
    15Mean of a Random Variable16Variance and Covariance of Random Variables17Means and Variances of Linear Combinations of Random Variables18Chebyshev’s Theorem19Discrete Probability Distributions20Continuous Probability Distributions21Fundamental Sampling Distributions22Sampling Distributions and Data Descriptions23Random Sampling24Sampling Distributions25Sampling Distribution of Means and the Central Limit Theorem26Sampling Distribution of S227t-Distribution28F-Quantile and Probability Plots29Single Sample & One- and Two-Sample Estimation Problems30Single Sample & One- and Two-Sample Tests of Hypotheses31The Use of P-Values for Decision Making in Testing Hypotheses
    32Linear Regression and Correlation33Least Squares and the Fitted Model34Multiple Linear Regression and Certain Nonlinear Regression Models35Linear Regression Model Using Matrices36Properties of the Least Squares Estimators
    11 min read
    Topic 13 of 36
    Topic Study Note Illustration
    13

    Bayes’ Rule

    Bayes' Rule is one of the most important and powerful concepts in probability theory and statistics. It allows you to update the probability of an event based...

    Bayes' Rule

    Bayes' Rule is one of the most important and powerful concepts in probability theory and statistics. It allows you to update the probability of an event based on new evidence. The rule is named after the Reverend Thomas Bayes, an 18th-century statistician who introduced the concept of conditional probability.

    Bayes' Rule helps us to calculate posterior probabilities. In simple terms, it tells us how to revise our belief about an event (posterior probability) based on new data or evidence (likelihood), and it connects this to the initial belief (prior probability).

    Mathematical Formulation

    Bayes' Rule provides a way to compute the conditional probability P(A∣B)P(A \mid B)P(A∣B) of event AAA given that event BBB has occurred. It is written as:

    P(A∣B)=P(B∣A)P(A)P(B)P(A \mid B) = \frac{P(B \mid A) P(A)}{P(B)}P(A∣B)=P(B)P(B∣A)P(A)​

    Where:

    • P(A∣B)P(A \mid B)P(A∣B) is the posterior probability: the probability of event AAA occurring given that BBB has occurred.
    • P(B∣A)P(B \mid A)P(B∣A) is the likelihood: the probability of observing event BBB given that event AAA has occurred.
    • P(A)P(A)P(A) is the prior probability: the initial probability of event AAA occurring before any new evidence is observed.
    • P(B)P(B)P(B) is the marginal likelihood or evidence: the total probability of event BBB occurring, which can be computed as: P(B)=P(A)⋅P(B∣A)+P(¬A)⋅P(B∣¬A)P(B) = P(A) \cdot P(B \mid A) + P(\neg A) \cdot P(B \mid \neg A)P(B)=P(A)⋅P(B∣A)+P(¬A)⋅P(B∣¬A) where ¬A\neg A¬A denotes the complement of event AAA (i.e., the event where AAA does not happen).

    Interpretation

    Bayes' Rule provides a way to update your probability estimate for event AAA based on new evidence BBB. Here’s a breakdown of each component:

    • Prior probability (P(A)P(A)P(A)) represents your initial belief or knowledge about event AAA before any new information is taken into account.
    • Likelihood (P(B∣A)P(B \mid A)P(B∣A)) tells you how likely the evidence BBB is, assuming that AAA is true.
    • Posterior probability (P(A∣B)P(A \mid B)P(A∣B)) is your updated belief about the probability of event AAA, given the evidence BBB.
    • Marginal likelihood (P(B)P(B)P(B)) normalizes the equation to ensure the probabilities sum to 1. It represents the total probability of observing BBB, taking into account all possible scenarios.

    Example: Medical Diagnosis

    One of the most common applications of Bayes' Rule is in medical testing or diagnostic problems, where we want to determine the probability of a patient having a certain disease given the results of a diagnostic test.

    Let's assume we have the following information:

    • Event AAA: A person has the disease.
    • Event BBB: The test result is positive (i.e., the test indicates the person has the disease).

    We want to calculate the probability that the person actually has the disease given a positive test result, i.e., P(A∣B)P(A \mid B)P(A∣B).

    We are given:

    • Prior probability (P(A)P(A)P(A)): The probability that the person has the disease before the test result is known. For example, let’s say the disease affects 1% of the population: P(A)=0.01P(A) = 0.01P(A)=0.01
    • Likelihood (P(B∣A)P(B \mid A)P(B∣A)): The probability of a positive test result given that the person actually has the disease. For example, the test is 95% accurate in detecting the disease: P(B∣A)=0.95P(B \mid A) = 0.95P(B∣A)=0.95
    • False positive rate (P(B∣¬A)P(B \mid \neg A)P(B∣¬A)): The probability of a positive test result given that the person does not have the disease. For example, the test is 5% likely to incorrectly identify a healthy person as diseased: P(B∣¬A)=0.05P(B \mid \neg A) = 0.05P(B∣¬A)=0.05
    • Prior probability of not having the disease (P(¬A)P(\neg A)P(¬A)): Since 1% of the population has the disease, 99% do not: P(¬A)=0.99P(\neg A) = 0.99P(¬A)=0.99

    To calculate P(A∣B)P(A \mid B)P(A∣B), the probability of having the disease given a positive test result, we use Bayes' Rule:

    P(A∣B)=P(B∣A)P(A)P(B)P(A \mid B) = \frac{P(B \mid A) P(A)}{P(B)}P(A∣B)=P(B)P(B∣A)P(A)​

    First, we need to calculate P(B)P(B)P(B), the total probability of a positive test result. This is done using the law of total probability:

    P(B)=P(B∣A)P(A)+P(B∣¬A)P(¬A)P(B) = P(B \mid A) P(A) + P(B \mid \neg A) P(\neg A)P(B)=P(B∣A)P(A)+P(B∣¬A)P(¬A)

    Substituting the known values:

    P(B)=(0.95×0.01)+(0.05×0.99)=0.0095+0.0495=0.059P(B) = (0.95 \times 0.01) + (0.05 \times 0.99) = 0.0095 + 0.0495 = 0.059P(B)=(0.95×0.01)+(0.05×0.99)=0.0095+0.0495=0.059

    Now, applying Bayes' Rule:

    P(A∣B)=0.95×0.010.059=0.00950.059≈0.161P(A \mid B) = \frac{0.95 \times 0.01}{0.059} = \frac{0.0095}{0.059} \approx 0.161P(A∣B)=0.0590.95×0.01​=0.0590.0095​≈0.161

    Thus, the probability that the person actually has the disease, given that they tested positive, is approximately 16.1%.

    Why is This Result Surprising?

    At first glance, one might expect a very high probability that the person has the disease given a positive test result. However, despite the test's high accuracy (95% sensitivity), the actual probability of having the disease is relatively low due to the low prior probability (only 1% of the population has the disease) and the false positive rate (5%). Even with a positive test result, the test is more likely to be a false positive due to the low base rate of the disease.

    Generalizing Bayes’ Rule: Multiple Hypotheses

    Bayes' Rule can also be extended to more than two possible events. Suppose you have multiple hypotheses H1,H2,…,HnH_1, H_2, \dots, H_nH1​,H2​,…,Hn​, and you want to calculate the probability of each hypothesis HiH_iHi​ given the evidence BBB. Bayes' Rule in this case becomes:

    P(Hi∣B)=P(B∣Hi)P(Hi)∑j=1nP(B∣Hj)P(Hj)P(H_i \mid B) = \frac{P(B \mid H_i) P(H_i)}{\sum_{j=1}^{n} P(B \mid H_j) P(H_j)}P(Hi​∣B)=∑j=1n​P(B∣Hj​)P(Hj​)P(B∣Hi​)P(Hi​)​

    Where:

    • P(Hi∣B)P(H_i \mid B)P(Hi​∣B) is the posterior probability of hypothesis HiH_iHi​ given the evidence BBB.
    • P(B∣Hi)P(B \mid H_i)P(B∣Hi​) is the likelihood of observing BBB given hypothesis HiH_iHi​.
    • P(Hi)P(H_i)P(Hi​) is the prior probability of hypothesis HiH_iHi​.
    • The denominator normalizes the probabilities by summing over all possible hypotheses H1,H2,…,HnH_1, H_2, \dots, H_nH1​,H2​,…,Hn​.

    Summary of Key Concepts

    1. Bayes' Rule allows us to update our beliefs about an event (posterior probability) based on new evidence.
    2. The formula is: P(A∣B)=P(B∣A)P(A)P(B)P(A \mid B) = \frac{P(B \mid A) P(A)}{P(B)}P(A∣B)=P(B)P(B∣A)P(A)​ Where:
      • P(A∣B)P(A \mid B)P(A∣B) is the posterior probability.
      • P(B∣A)P(B \mid A)P(B∣A) is the likelihood.
      • P(A)P(A)P(A) is the prior probability.
      • P(B)P(B)P(B) is the marginal likelihood.
    3. Medical Diagnostics Example: Bayes' Rule can be used to calculate the probability of a person having a disease given a positive test result.
    4. Law of Total Probability is used to calculate P(B)P(B)P(B), the total probability of evidence BBB by considering all possible causes.
    5. Counterintuitive Results: Even with high test accuracy, the probability of having a disease may remain low if the prior probability is low.

    Bayes' Rule is widely used in fields such as statistics, machine learning, data science, and medical diagnostics. It provides a powerful framework for making decisions and updating beliefs based on new data.

    ← Previous topic 12
    Independence and the Product Rule
    Next topic 14 →
    Random Variables and Probability Distributions

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    11mremaining
    1.9kwords
    Intermediatelevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Probability and Statistics