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 (8)

AI Lesson 31
AI Lesson 31AI Lesson 31
AI Lesson 31
 
Fuzzy logic - copy
Fuzzy logic - copyFuzzy logic - copy
Fuzzy logic - copy
 
AI Lesson 30
AI Lesson 30AI Lesson 30
AI Lesson 30
 
AI Lesson 28
AI Lesson 28AI Lesson 28
AI Lesson 28
 
AI Lesson 25
AI Lesson 25AI Lesson 25
AI Lesson 25
 
L 27(tb)(et) ((ee)nptel)
L 27(tb)(et) ((ee)nptel)L 27(tb)(et) ((ee)nptel)
L 27(tb)(et) ((ee)nptel)
 
AI Lesson 09
AI Lesson 09AI Lesson 09
AI Lesson 09
 
L15 fuzzy logic
L15  fuzzy logicL15  fuzzy logic
L15 fuzzy logic
 

Similar to AI 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
 
Statistics_Hypothesis_Testing(p-value)
Statistics_Hypothesis_Testing(p-value)Statistics_Hypothesis_Testing(p-value)
Statistics_Hypothesis_Testing(p-value)
Tyler Vassallo
 

Similar to AI 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
 
Statistics_Hypothesis_Testing(p-value)
Statistics_Hypothesis_Testing(p-value)Statistics_Hypothesis_Testing(p-value)
Statistics_Hypothesis_Testing(p-value)
 
Probability Theory.pdf
Probability Theory.pdfProbability Theory.pdf
Probability Theory.pdf
 

More from Assistant Professor (20)

AI Lesson 41
AI Lesson 41AI Lesson 41
AI Lesson 41
 
AI Lesson 40
AI Lesson 40AI Lesson 40
AI Lesson 40
 
AI Lesson 39
AI Lesson 39AI Lesson 39
AI Lesson 39
 
AI Lesson 38
AI Lesson 38AI Lesson 38
AI Lesson 38
 
AI Lesson 37
AI Lesson 37AI Lesson 37
AI Lesson 37
 
AI Lesson 36
AI Lesson 36AI Lesson 36
AI Lesson 36
 
AI Lesson 35
AI Lesson 35AI Lesson 35
AI Lesson 35
 
AI Lesson 34
AI Lesson 34AI Lesson 34
AI Lesson 34
 
AI Lesson 33
AI Lesson 33AI Lesson 33
AI Lesson 33
 
AI Lesson 32
AI Lesson 32AI Lesson 32
AI Lesson 32
 
AI Lesson 29
AI Lesson 29AI Lesson 29
AI Lesson 29
 
AI Lesson 26
AI Lesson 26AI Lesson 26
AI Lesson 26
 
AI Lesson 24
AI Lesson 24AI Lesson 24
AI Lesson 24
 
AI Lesson 23
AI Lesson 23AI Lesson 23
AI Lesson 23
 
AI Lesson 22
AI Lesson 22AI Lesson 22
AI Lesson 22
 
AI Lesson 21
AI Lesson 21AI Lesson 21
AI Lesson 21
 
Lesson 20
Lesson 20Lesson 20
Lesson 20
 
AI Lesson 19
AI Lesson 19AI Lesson 19
AI Lesson 19
 
AI Lesson 18
AI Lesson 18AI Lesson 18
AI Lesson 18
 
AI Lesson 17
AI Lesson 17AI Lesson 17
AI Lesson 17
 

Recently uploaded

Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Recently uploaded (20)

Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 

AI 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