Bayes Rule Supervisor : Ass. Prof. Dr. Rawaa Ismail Farahan By : Sattar Jabbar Jawad Al-Mosawi Abdul-Jabbar Ajeel Jaleel
Probability Probability is the measure of the likelihood that an event will occur. Probability is quantified as a number between 0 and 1 (where 0 indicates impossibility and 1 indicates certainty). 1
Example A simple example is the toss of a fair (unbiased) coin. Since the two outcomes are equally probable, the probability of "heads" equals the probability of "tails", so the probability is 1/2 (or 50%) chance of either "heads" or "tails". 2
Conditional Probability a conditional probability measures the probability of an event given that (by assumption, presumption, assertion or evidence) another event has occurred. If the event of interest is A and the event B is known or assumed to have occurred, the conditional probability of A given B, or the probability of A under the condition B, is usually written as P(A|B) . 3
When Apply Bayes’ Theorem Part of the challenge in applying Bayes' theorem involves recognizing the types of problems that warrant its use. You should consider Bayes' theorem when the following conditions exist. Within the sample space, there exists an event B, for which P(B) > 0 . The analytical goal is to compute a conditional probability of the form: P(A k | B). You know at least one of the two sets of probabilities described below. - P(A ∩ B) for each A k - P(A k ) and P( B|A k ) for each A k 4
Explanation Where A and B are events: P(A) and P(B) are the probabilities of A and B without regard to each other. P(A | B), a conditional probability, is the probability of observing event A given that B is true. P(B|A) is the probability of observing event B given that A is true. 5
Bayesian inference Bayesian inference is a method of statistical inference in which Bayes' theorem is used to update the probability for a hypothesis as evidence. It Involves: Prior Probability : The initial Probability based on the present level of information. Posterior Probability : A revised Probability based on additional information. 6
Understanding Bayes' Theorem Bayes' Theorem calculates probability based on prior knowledge. It helps in updating beliefs after new evidence is observed. The formula is P(A|B) = [P(B|A) * P(A)] / P(B). This means the probability of A given B is proportional to the likelihood of B given A. Components include P(A) the prior, P(B|A) the likelihood, and P(B) the marginal probability. Each component plays a critical role. Bayes' Theorem is widely used in various fields including statistics, finance, and machine learning for making informed decisions. Understanding Bayes' theorem helps in analyzing phenomena with uncertainty. It allows for dynamic updating of predictions as new data arises. Conditional probability is defined as the likelihood of an event or outcome occurring, based on the occurrence of a previous event or outcome. Conditional probability is calculated by multiplying the probability of the preceding event by the updated probability of the succeeding, or conditional, event. 7
The Bayes Theorem was developed and named for Thomas Bayes(1702-1761). Show the Relation between one conditional probability and its inverse. Provide a mathematical rule for revising an estimate or forecast in light of experience and observation. Continue... In the 18th Century, Thomas Bayes, Most read 9 10 Ponder this question: " Does God really exist ?" Being interested in the mathematics, he attempt to develop a formula to arrive at the probability that God does exist based on the evidence that was available to him on earth. Later, Laplace refined Bayes' work and gave it the name "Bayes' Theorem". BAYES RULE 8
Benefits of Conditional Probability Conditional probability enhances decision-making by allowing predictions based on prior knowledge, leading to more informed choices in uncertain situations. It is essential for fields like statistics, finance, and machine learning, enabling models to learn from past data and make future predictions. Bayes' Theorem provides a systematic way to update probabilities as new evidence becomes available, improving the accuracy of conclusions drawn from data. Challenges in Understanding Understanding conditional probability requires a shift from traditional probability concepts, which can be confusing for beginners and lead to misconceptions. Application of Bayes' Theorem can be mathematically intensive, deterring those without a strong mathematical background from fully grasping its utility. Misinterpretations of conditional relationships can lead to erroneous conclusions, especially in real-world applications where probabilities are not accurately known. 9
Bayes' Theorem Applications 01 Healthcare Bayes' Theorem is essential in medical diagnosis, helping doctors assess the probability of diseases based on patient symptoms and test... 02 Finance In finance, Bayes' Theorem aids in risk assessment and portfolio management, allowing investors to make informed decisions based on updated... 03 Machine Learning Machine learning algorithms utilize Bayes' Theorem for classification and regression tasks, improving predictions by continuously updating beliefs with new data. 04 Marketing Marketers apply Bayes' Theorem to analyze consumer behavior and optimize strategies, predicting customer preferences and trends effectively. 05 Sports Analytics Bayes' Theorem helps sports analysts evaluate player performance and team strategies, providing insights for better game predictions and outcomes. 10
Bayesian Advantage & Disadvantage Advantages of Bayesian Provides a systematic approach to updating beliefs with new data, improving decision-making processes over time. Incorporates prior knowledge, enhancing the interpretation of results and leading to more informed conclusions. Offers flexibility in modeling complex situations with various distributions and parameters, accommodating uncertainty effectively. Bayes' Theorem allows for the incorporation of prior knowledge into probability assessments, enhancing analysis accuracy. It provides a systematic approach for updating beliefs based on new evidence, making it versatile in various fields. The theorem helps in decision-making under uncertainty by quantifying the impact of new information. Enables precise diagnosis by updating probabilities with new evidence, improving accuracy over traditional methods. Facilitates decision-making under uncertainty, particularly in ambiguous medical situations. Encourages clinician engagement with statistical reasoning, enhancing overall diagnostic skills and patient care. 11
Challenges and Pitfalls Misinterpretation of prior probabilities can lead to incorrect conclusions or biased results during analysis. Complexity in calculation arises when dealing with multiple variables or large datasets, making it computationally intensive. Assumption of independence among events may not hold true in real-world scenarios, leading to inaccurate predictions. Limitations of Bayes' Theorem Requires accurate prior probabilities, which can be challenging to obtain and may lead to misleading results. Complexity in calculations can be overwhelming, especially for practitioners without strong statistical backgrounds. May lead to over-reliance on probabilistic reasoning, potentially overshadowing clinical experience and intuition. Disadvantages of Bayesian Can be computationally intensive, requiring sophisticated algorithms and resources, especially for complex models. The choice of prior can significantly influence results, sometimes leading to biased conclusions if not chosen carefully. Requires a deeper understanding of probability and statistics, making it less accessible for those unfamiliar with these concepts. 12
Marie is getting married tomorrow, at an outdoor ceremony in the desert. In recent years, it has rained only 5 days each year. Unfortunately, the weatherman has predicted rain for tomorrow. When it actually rains, the weatherman correctly forecasts rain 90% of the time. When it doesn't rain, he incorrectly forecasts rain 10% of the time. What is the probability that it will rain on the day of Marie's wedding? Example of Bayes Rule 13
• The sample space is defined by two mutually-exclusive events - it rains or it does not rain. Additionally, a third event occurs when the weatherman predicts rain. Notation for these events appears below. Event A₁. It rains on Marie's wedding. Event A₂. It does not rain on Marie's wedding. Event B. The weatherman predicts rain. Solution 14
In terms of probabilities, we know the following: P(A₁) = 5/365 = 0.0136985 [It rains 5 days out of the year.] P(A2) = 360/365 = 0.9863014 [It does not rain 360 days out of the year.] P(B|A₁) = 0.9 [When it rains, the weatherman predicts rain 90% of the time.] P(B|A₂) = 0.1 [When it does not rain, the weatherman predicts rain 10% of the time.] Solution 15
We want to know P(A₁ | B), the probability it will rain on the day of Marie's wedding, given a forecast for rain by the weatherman. The answer can be determined from Bayes' theorem, as shown below: Solution = 0.111 16 Note the somewhat unintuitive result. Even when the weatherman predicts rain, it rains only about 11% of the time. Despite the weatherman's gloomy prediction, there is a good chance that Marie will not get rained on at her wedding.
As a numerical example, imagine there is a drug test that is 98% accurate, meaning that 98% of the time, it shows a true positive result for someone using the drug, and 98% of the time, it shows a true negative result for nonusers of the drug. Next, assume 0.5% of people use the drug. If a person selected at random tests positive for the drug, the following calculation can be made to determine the probability the person is actually a user of the drug where the terms are: Example of Bayes' Theorem 17
A = Probability that a positive test result is true B = Percent of people that use the drug A x B = the probability that a positive test result is true ( 1 - A ) x ( 1 - B ) = Probability that a negative test result is true The formula would look like this: Example of Bayes' Theorem = Probability of Taking the Drug Using the values, the calculation works out as follows: 18
Example of Bayes' Theorem Bayes' Theorem shows that even if a person tested positive in this scenario, there is a 19.76% chance the person takes the drug A n 80.24% chance they don’t take drug 19