Upcoming SlideShare
×

# 04 Bayes Rule

1,114 views

Published on

Published in: Technology, Education
0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total views
1,114
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
14
0
Likes
0
Embeds 0
No embeds

No notes for slide

### 04 Bayes Rule

1. 1. Stat310 Bayes Rule Hadley Wickham Thursday, 21 January 2010
2. 2. Practice quiz Don’t worry - it’s just a practice. You have until 1:10. Don’t hand it in. Thursday, 21 January 2010
3. 3. Homework Due by the end of class! (Or if you’ve forgotten it, you have until 9am tomorrow morning to slip it under my ofﬁce door - DH 2058) Will probably be an additional help session Tuesday at 4pm. Fill out doodle form if you haven’t already. Thursday, 21 January 2010
4. 4. 1. Basic properties of probabilities 2. Working with conditional probabilities 3. Bayes’ rule & natural frequencies 4. Toolbox 5. Intro to random variables 6. For next time Thursday, 21 January 2010
5. 5. Basics P(A') = 1 - P(A) If A ⊂ B, then P(A) ≤ P(B) P(A ∪ B) = P(A) + P(B) - P(A ∩ B) You should be able to see these from a venn diagram, and if mathematically inclined prove them. Thursday, 21 January 2010
6. 6. Using P(A | B) Assume that A and B are independent. Show that A and B' are independent. In homeworks and exams, correctly turning a word problem into a math problem will often get you a few points. Thursday, 21 January 2010
7. 7. Convert to math Imagine you select a person at random and give them an HIV test. If the HIV test is positive what’s the probability that they have HIV? If you have HIV, the probability that the test is positive is 99.9% If you don’t have HIV, the probability that the test is negative is 99.99% In Texas, about 13 people per 100,000 have HIV. Thursday, 21 January 2010
8. 8. Events T+ = {test is positive} T- = {test is negative} H = {has HIV} P(T+ | H) = 0.99 P(T- | H') = 0.9999 P(H) = 0.00012 We want to ﬁnd P(H | T+) Thursday, 21 January 2010
9. 9. Rearranging... Thursday, 21 January 2010
10. 10. Bayes’ rule P (B|A)P (A) P (A|B) = P (B) (Often need to use law of total probability down here) Thursday, 21 January 2010
11. 11. Alternative approach Use natural frequencies. Pick a large number of people and break into categories. Is much more intuitive, and helps you understand why this surprising result is true. Thursday, 21 January 2010
12. 12. Toolbox Complements Convert union to sum Convert intersection to conditioning Convert intersection to product (if independent) Use law of total probability Switch conditioning (Bayes’ rule) Thursday, 21 January 2010
13. 13. Random variables Thursday, 21 January 2010
14. 14. Intro to rv’s Probability is a set function. Kind of tricky to deal with. Easier to deal with functions of numbers. Want to ignore details of problem (e.g. speciﬁc events) and focus on essence. Real world ➙ mathematical world Thursday, 21 January 2010
15. 15. Deﬁnitions A random variable is a random experiment with a numeric sample space. Usually given a capital letter like X, Y or Z. (More formally a random variable is a function that converts outcomes from a random experiment into numbers) The space (or support) of a random variable is the range of the function (cf. sample space) Thursday, 21 January 2010
16. 16. Deﬁnitions If the size of the support is ﬁnite or countably inﬁnite, then the random variable is discrete. If the size of the support is uncountably inﬁnite, then the random variable is continuous. Thursday, 21 January 2010
17. 17. Your turn The random experiment is to go to Vegas with \$100 and play blackjack until you make \$1,000 or lose all your money. How many different random variables can you generate from this random experiment? Brainstorm in pairs. Thursday, 21 January 2010
18. 18. Next week We’re going to start working with sums and a little bit of calculus. http://tutorial.math.lamar.edu/Classes/ CalcI/SummationNotation.aspx Basic calculus: differentiation & integration of (e.g.) polynomials Read section 2.5 Thursday, 21 January 2010
19. 19. Thursday, 21 January 2010