120 likes | 240 Views
6.3 Bayes Theorem. We can use Bayes Theorem…. …when we know some conditional probabilities, but wish to know others. For example: We know P(test positive|have disease), and we wish to know P(have disease|test positive ). Ex. 1 (book ex 2- p. 419).
E N D
We can use Bayes Theorem… • …when we know some conditional probabilities, but wish to know others. • For example: We know P(test positive|have disease), and we wish to know P(have disease|test positive)
Ex. 1 (book ex 2- p. 419) • Suppose that one person in 100,000 has a particular rare disease for which there is a fairly accurate diagnostic test. This test is correct 99% of the times for someone who has the disease and 99.5%% of the time for someone who does not.
Define E, F, E’, F’ Let F=event one has the disease E=event one tests positive We know that P(F) = 1/100,000 = .00001 P(E|F)= P(positive|disease) = .99 and P(E’ |F’ ) = P(negative| don’t have disease) = .995 Determine P(F|E) = P(has disease|test positive) = ___ and P ( F’ |E’ )= P(does not have disease |test negative)= ___
Find P(F|E) and P(F’| E’) • P(F|E) = = 0.002 • P(F’ | E’)= = 0.9999999
Ex. 2: F=studied for final, E=passed class Assume: P(F) = P(studied)=.8 P(E|F)= P(passed|studied)=.9 and P(E|F ’ ) = P(passed|didn’t study)=.2 Find P(F|E) = P(studied|passed)= ___ P (F’ | E’ )= P(didn’t study | failed) = ___
Spam filters Ex. 3: Spam filters Idea: spam has words like “offer”, “special”, “opportunity”, “Rolex”, … Non-spam has words like “mom”, “lunch”,… False negatives: when we fail to detect spam False positives: when non-spam is seen as spam Let S=spam E=has a certain word Assume P(S)=0.5
Given a message says “Rolex”, find probability it is spam Consider that “Rolex” occurs in 250/2000= .125 spam messages and in 5/1000=.005 non-spam messages. Assume P(S)=0.5 Ex: P(S|uses word “Rolex”) = = .962