SlideShare a Scribd company logo
1 of 5
Download to read offline
Module
                10
       Reasoning with
          Uncertainty -
Probabilistic reasoning

              Version 2 CSE IIT, Kharagpur
Lesson
                 27
Probabilistic Inference
              Version 2 CSE IIT, Kharagpur
10.4 Probabilistic Inference Rules

Two rules in probability theory are important for inferencing, namely, the product rule
and the Bayes' rule.




Here is a simple example, of application of Bayes' rule.

Suppose you have been tested positive for a disease; what is the probability that you
actually have the disease?

It depends on the accuracy and sensitivity of the test, and on the background (prior)
probability of the disease.

Let P(Test=+ve | Disease=true) = 0.95, so the false negative rate,
P(Test=-ve | Disease=true), is 5%.

Let P(Test=+ve | Disease=false) = 0.05, so the false positive rate is also 5%.
Suppose the disease is rare: P(Disease=true) = 0.01 (1%).

Let D denote Disease and "T=+ve" denote the positive Tes.

Then,
                             P(T=+ve|D=true) * P(D=true)
P(D=true|T=+ve) = ------------------------------------------------------------
                 P(T=+ve|D=true) * P(D=true)+ P(T=+ve|D=false) * P(D=false)




                                                            Version 2 CSE IIT, Kharagpur
0.95 * 0.01
                    =     -------------------------------- = 0.161
                           0.95*0.01 + 0.05*0.99

So the probability of having the disease given that you tested positive is just 16%. This
seems too low, but here is an intuitive argument to support it. Of 100 people, we expect
only 1 to have the disease, but we expect about 5% of those (5 people) to test positive. So
of the 6 people who test positive, we only expect 1 of them to actually have the disease;
and indeed 1/6 is approximately 0.16.

In other words, the reason the number is so small is that you believed that this is a rare
disease; the test has made it 16 times more likely you have the disease, but it is still
unlikely in absolute terms. If you want to be "objective", you can set the prior to uniform
(i.e. effectively ignore the prior), and then get

                            P(T=+ve|D=true) * P(D=true)
P(D=true|T=+ve) = ------------------------------------------------------------
                                         P(T=+ve)

                               0.95 * 0.5                    0.475
                           = --------------------------    = -------    = 0.95
                              0.95*0.5 + 0.05*0.5              0.5

This, of course, is just the true positive rate of the test. However, this conclusion relies on
your belief that, if you did not conduct the test, half the people in the world have the
disease, which does not seem reasonable.

A better approach is to use a plausible prior (eg P(D=true)=0.01), but then conduct
multiple independent tests; if they all show up positive, then the posterior will increase.
For example, if we conduct two (conditionally independent) tests T1, T2 with the same
reliability, and they are both positive, we get

                         P(T1=+ve|D=true) * P(T2=+ve|D=true) * P(D=true)
P(D=true|T1=+ve,T2=+ve) = ------------------------------------------------------------
                                        P(T1=+ve, T2=+ve)

                   0.95 * 0.95 * 0.01                  0.009
             = -----------------------------         = ------- = 0.7826
              0.95*0.95*0.01 + 0.05*0.05*0.99           0.0115
The assumption that the pieces of evidence are conditionally independent is called the
naive Bayes assumption. This model has been successfully used for mainly application
including classifying email as spam (D=true) or not (D=false) given the presence of
various key words (Ti=+ve if word i is in the text, else Ti=-ve). It is clear that the words
are not independent, even conditioned on spam/not-spam, but the model works
surprisingly well nonetheless.




                                                                  Version 2 CSE IIT, Kharagpur
In many problems, complete independence of variables do not exist. Though many of
them are conditionally independent.

X and Y are conditionally independent given Z iff




In full: X and Y are conditionally independent given Z iff for any instantiation x, y, z of
X, Y,Z we have




An example of conditional independence:

Consider the following three Boolean random variables:

LeaveBy8, GetTrain, OnTime

Suppose we can assume that:

P(OnTime | GetTrain, LeaveBy8) = P(OnTime | GetTrain)

but NOT    P(OnTime | LeaveBy8) = P(OnTime)

Then, OnTime is dependent on LeaveBy8, but independent of LeaveBy8 given GetTrain.

We can represent P(OnTime | GetTrain, LeaveBy8) = P(OnTime | GetTrain)

graphically by: LeaveBy8 -> GetTrain -> OnTime




                                                           Version 2 CSE IIT, Kharagpur

More Related Content

What's hot

Probabilistic Reasoning
Probabilistic ReasoningProbabilistic Reasoning
Probabilistic Reasoning
Tameem Ahmad
 
C2 st lecture 11 the t-test handout
C2 st lecture 11   the t-test handoutC2 st lecture 11   the t-test handout
C2 st lecture 11 the t-test handout
fatima d
 

What's hot (20)

Bayes Classification
Bayes ClassificationBayes Classification
Bayes Classification
 
PROOF TECHNIQUES
PROOF TECHNIQUESPROOF TECHNIQUES
PROOF TECHNIQUES
 
Hypothesis Testing
Hypothesis TestingHypothesis Testing
Hypothesis Testing
 
Testing a Claim About a Proportion
Testing a Claim About a ProportionTesting a Claim About a Proportion
Testing a Claim About a Proportion
 
Bayes theorem
Bayes theoremBayes theorem
Bayes theorem
 
Open sentences-algebra1
Open sentences-algebra1Open sentences-algebra1
Open sentences-algebra1
 
Lecture3
Lecture3Lecture3
Lecture3
 
Stat sample test ch 11
Stat sample test ch 11Stat sample test ch 11
Stat sample test ch 11
 
Week8 livelecture2010 follow_up
Week8 livelecture2010 follow_upWeek8 livelecture2010 follow_up
Week8 livelecture2010 follow_up
 
Week 7 quiz_review_mini_tab_2011
Week 7 quiz_review_mini_tab_2011Week 7 quiz_review_mini_tab_2011
Week 7 quiz_review_mini_tab_2011
 
Probabilistic Reasoning
Probabilistic ReasoningProbabilistic Reasoning
Probabilistic Reasoning
 
Math3010 week 5
Math3010 week 5Math3010 week 5
Math3010 week 5
 
Chi square
Chi squareChi square
Chi square
 
Calculating a single sample z test by hand
Calculating a single sample z test by handCalculating a single sample z test by hand
Calculating a single sample z test by hand
 
Test hypothesis
Test hypothesisTest hypothesis
Test hypothesis
 
C2 st lecture 11 the t-test handout
C2 st lecture 11   the t-test handoutC2 st lecture 11   the t-test handout
C2 st lecture 11 the t-test handout
 
Bayes' theorem
Bayes' theoremBayes' theorem
Bayes' theorem
 
Quantitative Methods for Lawyers - Class #13 - Students "t" Distribution - Pr...
Quantitative Methods for Lawyers - Class #13 - Students "t" Distribution - Pr...Quantitative Methods for Lawyers - Class #13 - Students "t" Distribution - Pr...
Quantitative Methods for Lawyers - Class #13 - Students "t" Distribution - Pr...
 
02a one sample_t-test
02a one sample_t-test02a one sample_t-test
02a one sample_t-test
 
Foundations of Statistics for Ecology and Evolution. 2. Hypothesis Testing
Foundations of Statistics for Ecology and Evolution. 2. Hypothesis TestingFoundations of Statistics for Ecology and Evolution. 2. Hypothesis Testing
Foundations of Statistics for Ecology and Evolution. 2. Hypothesis Testing
 

Viewers also liked (12)

Lesson 27
Lesson 27Lesson 27
Lesson 27
 
APDMM04 : Digital advertising – terms & terminology
APDMM04 : Digital advertising – terms & terminologyAPDMM04 : Digital advertising – terms & terminology
APDMM04 : Digital advertising – terms & terminology
 
Educational technology 2
Educational technology 2Educational technology 2
Educational technology 2
 
Computer and information technology lesson 1
Computer and information technology lesson 1Computer and information technology lesson 1
Computer and information technology lesson 1
 
Educational technology 2
Educational technology 2Educational technology 2
Educational technology 2
 
Basic computer and_intenet_terminologies
Basic computer and_intenet_terminologiesBasic computer and_intenet_terminologies
Basic computer and_intenet_terminologies
 
Educational Technology
Educational TechnologyEducational Technology
Educational Technology
 
Educational technology 2
Educational technology 2Educational technology 2
Educational technology 2
 
Computer hardware presentation
Computer hardware presentationComputer hardware presentation
Computer hardware presentation
 
01-Educational Technology 2
01-Educational Technology 201-Educational Technology 2
01-Educational Technology 2
 
Computer hardware component. ppt
Computer hardware component. pptComputer hardware component. ppt
Computer hardware component. ppt
 
basics of computer system ppt
basics of computer system pptbasics of computer system ppt
basics of computer system ppt
 

Similar to Lesson 27

Chi Square
Chi SquareChi Square
Chi Square
Jolie Yu
 
Hypothesis Testing techniques in social research.ppt
Hypothesis Testing techniques in social research.pptHypothesis Testing techniques in social research.ppt
Hypothesis Testing techniques in social research.ppt
Solomonkiplimo
 
FALLSEM2023-24_MSM5001_ETH_VL2023240106334_2023-09-19_Reference-Material-I (3...
FALLSEM2023-24_MSM5001_ETH_VL2023240106334_2023-09-19_Reference-Material-I (3...FALLSEM2023-24_MSM5001_ETH_VL2023240106334_2023-09-19_Reference-Material-I (3...
FALLSEM2023-24_MSM5001_ETH_VL2023240106334_2023-09-19_Reference-Material-I (3...
swethaagri
 
Statistics_Hypothesis_Testing(p-value)
Statistics_Hypothesis_Testing(p-value)Statistics_Hypothesis_Testing(p-value)
Statistics_Hypothesis_Testing(p-value)
Tyler Vassallo
 

Similar to Lesson 27 (20)

Econometrics chapter 5-two-variable-regression-interval-estimation-
Econometrics chapter 5-two-variable-regression-interval-estimation-Econometrics chapter 5-two-variable-regression-interval-estimation-
Econometrics chapter 5-two-variable-regression-interval-estimation-
 
Testing a claim about a mean
Testing a claim about a mean  Testing a claim about a mean
Testing a claim about a mean
 
Mayo class #7 March 6 slides
Mayo class #7 March 6 slidesMayo class #7 March 6 slides
Mayo class #7 March 6 slides
 
Chi Square
Chi SquareChi Square
Chi Square
 
2.statistical DEcision makig.pptx
2.statistical DEcision makig.pptx2.statistical DEcision makig.pptx
2.statistical DEcision makig.pptx
 
Estimating sample size through simulations
Estimating sample size through simulationsEstimating sample size through simulations
Estimating sample size through simulations
 
lecture8.ppt
lecture8.pptlecture8.ppt
lecture8.ppt
 
Lecture8
Lecture8Lecture8
Lecture8
 
Memorization of Various Calculator shortcuts
Memorization of Various Calculator shortcutsMemorization of Various Calculator shortcuts
Memorization of Various Calculator shortcuts
 
Test of significance (t-test, proportion test, chi-square test)
Test of significance (t-test, proportion test, chi-square test)Test of significance (t-test, proportion test, chi-square test)
Test of significance (t-test, proportion test, chi-square test)
 
2_5332511410507220042.ppt
2_5332511410507220042.ppt2_5332511410507220042.ppt
2_5332511410507220042.ppt
 
Hypothesis Testing techniques in social research.ppt
Hypothesis Testing techniques in social research.pptHypothesis Testing techniques in social research.ppt
Hypothesis Testing techniques in social research.ppt
 
Testing a claim about a proportion
Testing a claim about a proportion  Testing a claim about a proportion
Testing a claim about a proportion
 
Test of-significance : Z test , Chi square test
Test of-significance : Z test , Chi square testTest of-significance : Z test , Chi square test
Test of-significance : Z test , Chi square test
 
Lecture3
Lecture3Lecture3
Lecture3
 
Introduction to Bayesian Statistics.ppt
Introduction to Bayesian Statistics.pptIntroduction to Bayesian Statistics.ppt
Introduction to Bayesian Statistics.ppt
 
Statistical tests
Statistical testsStatistical tests
Statistical tests
 
Test of significance
Test of significanceTest of significance
Test of significance
 
FALLSEM2023-24_MSM5001_ETH_VL2023240106334_2023-09-19_Reference-Material-I (3...
FALLSEM2023-24_MSM5001_ETH_VL2023240106334_2023-09-19_Reference-Material-I (3...FALLSEM2023-24_MSM5001_ETH_VL2023240106334_2023-09-19_Reference-Material-I (3...
FALLSEM2023-24_MSM5001_ETH_VL2023240106334_2023-09-19_Reference-Material-I (3...
 
Statistics_Hypothesis_Testing(p-value)
Statistics_Hypothesis_Testing(p-value)Statistics_Hypothesis_Testing(p-value)
Statistics_Hypothesis_Testing(p-value)
 

More from Avijit Kumar (20)

Lesson 18
Lesson 18Lesson 18
Lesson 18
 
Lesson 19
Lesson 19Lesson 19
Lesson 19
 
Lesson 20
Lesson 20Lesson 20
Lesson 20
 
Lesson 21
Lesson 21Lesson 21
Lesson 21
 
Lesson 23
Lesson 23Lesson 23
Lesson 23
 
Lesson 25
Lesson 25Lesson 25
Lesson 25
 
Lesson 24
Lesson 24Lesson 24
Lesson 24
 
Lesson 22
Lesson 22Lesson 22
Lesson 22
 
Lesson 26
Lesson 26Lesson 26
Lesson 26
 
Lesson 28
Lesson 28Lesson 28
Lesson 28
 
Lesson 29
Lesson 29Lesson 29
Lesson 29
 
Lesson 30
Lesson 30Lesson 30
Lesson 30
 
Lesson 31
Lesson 31Lesson 31
Lesson 31
 
Lesson 32
Lesson 32Lesson 32
Lesson 32
 
Lesson 33
Lesson 33Lesson 33
Lesson 33
 
Lesson 36
Lesson 36Lesson 36
Lesson 36
 
Lesson 35
Lesson 35Lesson 35
Lesson 35
 
Lesson 37
Lesson 37Lesson 37
Lesson 37
 
Lesson 39
Lesson 39Lesson 39
Lesson 39
 
Lesson 38
Lesson 38Lesson 38
Lesson 38
 

Recently uploaded

Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Peter Udo Diehl
 

Recently uploaded (20)

UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering Teams
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 

Lesson 27

  • 1. Module 10 Reasoning with Uncertainty - Probabilistic reasoning Version 2 CSE IIT, Kharagpur
  • 2. Lesson 27 Probabilistic Inference Version 2 CSE IIT, Kharagpur
  • 3. 10.4 Probabilistic Inference Rules Two rules in probability theory are important for inferencing, namely, the product rule and the Bayes' rule. Here is a simple example, of application of Bayes' rule. Suppose you have been tested positive for a disease; what is the probability that you actually have the disease? It depends on the accuracy and sensitivity of the test, and on the background (prior) probability of the disease. Let P(Test=+ve | Disease=true) = 0.95, so the false negative rate, P(Test=-ve | Disease=true), is 5%. Let P(Test=+ve | Disease=false) = 0.05, so the false positive rate is also 5%. Suppose the disease is rare: P(Disease=true) = 0.01 (1%). Let D denote Disease and "T=+ve" denote the positive Tes. Then, P(T=+ve|D=true) * P(D=true) P(D=true|T=+ve) = ------------------------------------------------------------ P(T=+ve|D=true) * P(D=true)+ P(T=+ve|D=false) * P(D=false) Version 2 CSE IIT, Kharagpur
  • 4. 0.95 * 0.01 = -------------------------------- = 0.161 0.95*0.01 + 0.05*0.99 So the probability of having the disease given that you tested positive is just 16%. This seems too low, but here is an intuitive argument to support it. Of 100 people, we expect only 1 to have the disease, but we expect about 5% of those (5 people) to test positive. So of the 6 people who test positive, we only expect 1 of them to actually have the disease; and indeed 1/6 is approximately 0.16. In other words, the reason the number is so small is that you believed that this is a rare disease; the test has made it 16 times more likely you have the disease, but it is still unlikely in absolute terms. If you want to be "objective", you can set the prior to uniform (i.e. effectively ignore the prior), and then get P(T=+ve|D=true) * P(D=true) P(D=true|T=+ve) = ------------------------------------------------------------ P(T=+ve) 0.95 * 0.5 0.475 = -------------------------- = ------- = 0.95 0.95*0.5 + 0.05*0.5 0.5 This, of course, is just the true positive rate of the test. However, this conclusion relies on your belief that, if you did not conduct the test, half the people in the world have the disease, which does not seem reasonable. A better approach is to use a plausible prior (eg P(D=true)=0.01), but then conduct multiple independent tests; if they all show up positive, then the posterior will increase. For example, if we conduct two (conditionally independent) tests T1, T2 with the same reliability, and they are both positive, we get P(T1=+ve|D=true) * P(T2=+ve|D=true) * P(D=true) P(D=true|T1=+ve,T2=+ve) = ------------------------------------------------------------ P(T1=+ve, T2=+ve) 0.95 * 0.95 * 0.01 0.009 = ----------------------------- = ------- = 0.7826 0.95*0.95*0.01 + 0.05*0.05*0.99 0.0115 The assumption that the pieces of evidence are conditionally independent is called the naive Bayes assumption. This model has been successfully used for mainly application including classifying email as spam (D=true) or not (D=false) given the presence of various key words (Ti=+ve if word i is in the text, else Ti=-ve). It is clear that the words are not independent, even conditioned on spam/not-spam, but the model works surprisingly well nonetheless. Version 2 CSE IIT, Kharagpur
  • 5. In many problems, complete independence of variables do not exist. Though many of them are conditionally independent. X and Y are conditionally independent given Z iff In full: X and Y are conditionally independent given Z iff for any instantiation x, y, z of X, Y,Z we have An example of conditional independence: Consider the following three Boolean random variables: LeaveBy8, GetTrain, OnTime Suppose we can assume that: P(OnTime | GetTrain, LeaveBy8) = P(OnTime | GetTrain) but NOT P(OnTime | LeaveBy8) = P(OnTime) Then, OnTime is dependent on LeaveBy8, but independent of LeaveBy8 given GetTrain. We can represent P(OnTime | GetTrain, LeaveBy8) = P(OnTime | GetTrain) graphically by: LeaveBy8 -> GetTrain -> OnTime Version 2 CSE IIT, Kharagpur