Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Statistics Bayes’ Theorem Unit Plan Bayes’ Theorem is used to deduce probabilities when the results of certain draws are hidden from view. The formal theorem is stated thus: 𝑃(𝐴|𝐵) = 𝑃(𝐴 𝑎𝑛𝑑 𝐵) [𝑃(𝐴 𝑎𝑛𝑑 𝐵) + 𝑃(𝐴′ 𝑎𝑛𝑑 𝐵)] Or, more fully: 𝑃(𝐴|𝐵) = [𝑃(𝐴) ∙ 𝑃(𝐵|𝐴)] [𝑃(𝐴) ∙ 𝑃(𝐵|𝐴) + 𝑃(𝐴′ ) ∙ 𝑃(𝐵|𝐴′ )] What is assumed in this formula is that we only saw the (second) draw that produced an outcome in Event B. We didn’t see the draw that produced either an outcome in A or in A-prime, however, we do “know” the probabilities of A or A-prime occurring. These probabilities are called the priors. I put “know” in quotation marks because sometimes the priors are educated guesses that are then “updated” based on new data. Don’t worry; you won’t be required to memorize or even to use this formula. There are several diagrambased ways to approach Bayes’ Theorem problems. However, we will examine how each of these methods produces the formula in its own way. The most common diagram methods are: 1.) Tree Diagram 2.) “Candy bar” Diagram 3.) Probability table 4.) Set of Axes These last three imagine a “synthetic” or “notional” sample (in other words, an imaginary group) in order to help you with the steps in your reasoning. Let’s look at an example and solve it using each of the diagrams. Then, it’s up to you to pick which one works the best for you, or if you just want to use the formula, that’s fine too. Ex: An entomologist spots what might be a rare species of beetle, due to the pattern on its back. In the rare species, 98% have the pattern. In the common species, 5% have the pattern. The rare species accounts for only 0.1% of the beetle population. How likely is the beetle to be rare? [1.9%] [synthetic sample size; n = 100,000 beetles] Interpretation: Even though 98% of rare beetles have this pattern, it is still quite unlikely that if you see this pattern you have found a rare beetle. The reason is, rare beetles are, well, rare, and the number of rare beetles with this pattern are far outnumbered by the common beetles with this pattern. In this case, the “priors” were the known populations of common and rare beetles. However, the draw that was hidden from us was what species this particular beetle was. Presumably, we’d have had to have taken this beetle back to the lab to “see” this draw and know whether or not it was the rare species. However, if we do this, Bayes’ Theorem could have told us in advance not to be too disappointed if it turns out to be a common beetle. Over 98% of the time, that’s what will happen. Bayes Theorem and Test Analysis Bayes’ Theorem is often used to evaluate the reliability of tests and signals. There are four important terms that are used in these sorts of problems: 1.) True Positive – The fire alarm rings, and there is a fire. 2.) False Positive – The fire alarm rings, but there is no fire. (“False Alarm”) 3.) True Negative – The fire alarm doesn’t ring, but that’s fine, because there is no fire. 4.) False Negative – The fire alarm doesn’t ring, but there really is a fire! HW: p. 139 #31, Bayes Theorem Worksheets #1-2 Bayesian Weirdness: Monty Hall Problem In the game “Let’s Make a Deal,” the host (Monty Hall) gives you a choice of three doors. Behind two of the doors are goats, behind one is a new car. Once you’ve made your choice, Monty opens one of the other doors to reveal a goat. Should you switch your choice to the other closed door, or stay with the door you have? “Common sense” would tell you that it makes no difference – but Bayes Theorem says otherwise. Let’s examine why: Strategy 1: Don’t switch doors W 1/3 W 1 0 L 0 W 2/3 L 1 L Under this strategy, you win 1/3rd of the time, and lose 2/3rds of the time. W 1/3 W 0 Strategy 2: Switch doors 1 L 1 W 2/3 L 0 L Under this strategy, you win 2/3rds of the time! Why? By revealing that one of the other doors contains a goat, Monty has introduced more information into the game. If the door you picked hid a goat, he was constrained from opening that door. Thus, in that case, he revealed with 100% probability that the third door in the game (that is, neither the one you picked nor the one he opened) hid the car. Since, 2/3rds of the time you had the goat, the proper strategy is to switch your choice to this third door. Of course, 1/3rd of the time, you will already have a car and switching will take you away from it, but that’s life. To write this out formally as a Bayes Theorem problem, we could say: P(Switch and Car) = 2/3 P(No Switch and Car) = 1/3 P(Car|Switch) = [2/3]/[2/3 + 1/3] = 2/3 Bayesian Weirdness: Vos Savant Controversy In her column in USA today, Marilyn Vos Savant (supposedly the smartest person in the world), posed the following question: “You know that a woman has two children and one of them is a boy. You do not know the gender of the other child. Assuming male and female births are equally likely, what is the probability that the other one is a girl?” The common-sense answer is 1/2, and many readers wrote in to argue just that. But they are wrong. Vos Savant’s answer, which she gave in the subsequent column, is 2/3. That is the correct answer. Let’s see why using a table and imagining 100 women with two children: st 1 child Boy 1st child Girl ∑ 2nd child Boy 25 (x) 25 (x) 50 2st child Girl 25 (x) 25 50 ∑ 50 50 100 As you can see, 75 women in this (imaginary) sample have a child who is a boy. Of those, 50 have a girl as their other child. That is: P(Girl|Boy) = 50/75 = 2/3 After seeing this solution, many readers still would not accept it! To prove it, Vos Savant said: “All women with two children, of whom at least one is a boy, regardless of the gender of the other child, send me a postcard with the gender of the other child written on it.” Lo and behold, almost exactly 2/3rds of the postcards had “Girl” written on them… and some readers still would not accept the answer! Von Savant has now vowed to fill a Stadium under the same criteria and vowed to force the skeptics to count the number of hands that go up when she asks “Is your other child a girl?” She is confident that 2/3rds of the hands would go up, and we should be too. Note that this solution does rely on some tricky language. If Vos Savant had said “the first child is a boy,” or that “exactly one child is a boy” then the answers would have been 50% and 100%, respectively, that the other child was a girl. Why does the answer change with this additional wording? Because, just like Monty, we are introducing additional information into the problem. What to do with additional information when we get it brings us to the final topic of this unit… Bayesian Updating Bayesian Updating The initial prior probabilities P(A) and P(A’) can be updated given additional information. If a Bayes-like trial is then observed again, this is sometimes called multi-pass testing. The example below shows how this works: Let’s return to the example on p. 139: We found that if someone tests positive, the chance they have the virus is (16/215) or 0.0744. This is still a pretty low probability that someone has the virus. Now let’s suppose we took all the people who tested positive, and tested them again. Now our priors are P(V) = (16/215) and P(V’)=(199/215). Apply Bayes’ theorem again and we can see that the probability that someone who tested positive twice in two trials has the virus is (256/455) or 0.5626. Much better! (Though still not great). The cost of this increased likelihood that a positive is a true positive, however ,is those people who really did have the virus, tested positive once, but tested negative on the second trial. What do we tell them? This is an ethical problem as well as a mathematical one. Bayesian Updating can be repeated as many times as desired in order to get the desired probability that a positive is a true positive. For example, if we ran the virus test a third time, the probability that three positive results in a row represents the presence of the virus rises to 0.9537, etc. Bayesian Updating can also be used to find priors. You may have noticed that the one “unrealistic” thing about the Bayes’ Theorem problems in this unit is that we somehow mysteriously “know” what percent of companies discriminate, or what percent of the population has a virus, before we begin the problem. Obviously, in real life, this information is often hidden from us. However, with Bayesian Updating, we can start out with arbitrary priors (with no information whatsoever, it makes sense to set P(A) = 0.5 and P(A’) = 0.5), and the Law of Large Numbers guarantees that with enough updating cycles the value of these priors will converge on their true value. HW: Bayes Theorem Worksheets #3-4 Bayes Theorem Test