Applying Bayes Theorem - PowerPoint PPT Presentation

1 / 34
About This Presentation
Title:

Applying Bayes Theorem

Description:

... is 0.001. The probability of a false positive (and also a false negative) is 1 ... A positive result on the test. If the test comes back positive, what is ... – PowerPoint PPT presentation

Number of Views:80
Avg rating:3.0/5.0
Slides: 35
Provided by: Dar966
Category:

less

Transcript and Presenter's Notes

Title: Applying Bayes Theorem


1
Lecture 10
2
Applying Bayes Theorem
  • P(HE) P(H) P(EH)
  • P(E)
  • Total probability theorem
  • P(E) P(EH)P(H) P(E-H)P(-H)

3
Using Bayes Theorem 1
  • A man is mugged, and claims the mugger is a black
    man. However, when the scene is re-enacted many
    times under comparable lighting by a court
    investigating the case, the victim correctly
    identifies the assailant only 80 of the time.
  • The population is 90 white and 10 black.
  • Neither race is more likely to be muggers.
  • The victim is equally likely to mistake white for
    black and black for white.
  • Whats the probabilty the mugger was black?

4
  • B The mugger was black
  • I The mugger was identified as black
  • P(BI) P(B) P(IB)
  • P(I)
  • P(I) P(IB)P(B) P(I-B)P(-B)
  • P(B) P(IB)
  • P(IB)P(B) P(I-B)P(-B)
  • 0.1 0.8 0.8 0.31
  • 0.8 0.1 0.2 0.9 0.26

5
Using Bayes Theorem 2
  • The frequency of a disease in the population is
    0.001. The probability of a false positive (and
    also a false negative) is 1.
  • H The subject has the disease.
  • E A positive result on the test.
  • If the test comes back positive, what is the
    probability that the subject has the disease?
    0-20, 20-40, 40-60, 60-80, 80-100?

6
  • P(HE) P(H) P(EH)
  • P(E)
  • P(E) P(EH)P(H) P(E-H)P(-H)
  • 0.99 0.001 0.01 0.01
  • 0.11

7
  • P(HE) P(H) P(EH)
  • P(E)
  • 0.001 0.99
  • 0.11
  • 0.1

8
Standard Deviation
  • The bigger the sample, the less likely it is that
    frequency of red marbles in the sample exactly
    matches the frequency of red marbles in
    population.
  • But the more likely it is that it will be close.
  • How do we measure closeness? Standard deviation.

9
  • A standard deviation measures the distance
    between population frequency and sample
    frequency.
  • One standard deviation is the distance within
    which 67 of samples will be.
  • Or, the probability of getting within one
    standard deviation of the frequency of the
    population is 67.

10
  • Two standard deviations are the distance within
    which 95 of samples will be.
  • Or, the probability of getting within two
    standard deviations of the frequency of the
    population is 95.

11
Sample of 10
  • When the population has 50 red marbles, P(R)
    0.5, the probability of the following frequencies
    in a sample of 10 is
  • P(f0) 0.001
  • P(f0.1) 0.01
  • P(f0.2) 0.04
  • P(f0.3) 0.12
  • P(f0.4) 0.20
  • P(f0.5) 0.25

P(f0.4 or 0.5 or 0.6) 0.20.250.2
0.65 P(f0.3 or 0.4 or 0.5 or 0.6 or 0.7)
0.120.20.250.20.12 0.89
picture
12
Sample of 100
  • P(f0.35) 0.001
  • P(f0.4) 0.011
  • P(f0.45) 0.049
  • P(f0.46) 0.058
  • P(f0.47) 0.067
  • P(f0.48) 0.075
  • P(f0.49) 0.078
  • P(f0.5) 0.08

P(0.4ltflt0.6) 0.756
picture
13
Exercise 5.11a
  • A frequency of 0.7 fig.5.23
  • Is 0.7 within two standard deviations of the
    population frequency?
  • A sample of 10? Yes.
  • A sample of 25? Yes.
  • A sample of 50? No.
  • So if the sample size is 50, there is a 95
    chance that the sample frequency will be closer
    to the population frequency than 0.7 is.

14
n and S.D.
15
Exercise 5.12
  • Your opponent is slightly better than you.
    Suppose that in the long run, they win 55 of
    points.
  • P(L) 0.55
  • A sequence of 9 points can be considered a sample
    of the population of points.
  • When the sample is large, f(L) approximates 0.55.
  • The smaller the sample, the greater the deviation
    from 0.55.
  • You win a game when the sample has a frequency of
    losing points less than 0.50. The more spread out
    the probabilities of the sample frequency, the
    more likely you are to win.

picture
16
  • Weve seen how to calculate the probability of
    getting a sample with a certain frequency if we
    know the population frequency.
  • In most cases we want to do the reverse.
  • We want to calculate the probability of certain
    population frequencies based on the sample
    frequency.

17
Real world population
Model of the population
Representation
Statistics
Selection
Model of the sample
Real world sample
Agree/ Disagree
18
  • Suppose we have a sample of 10 marbles, 5 of
    which are red.
  • What can we infer about the population?
  • The most likely frequency among the population is
    0.5. But we cannot be certain.
  • In fact the probability of a population of 50
    red marbles producing a sample of 50 red marbles
    is only 0.25.
  • The evidence tells us that the population
    frequency is probably near 50.

19
  • How near is near?
  • If we need to be 100 sure, we have to include
    every possibility.
  • i.e. 0.5 -0.5

20
  • If we are only interested in exactly the right
    answer, we can estimate a probability of 0.5 -0.
  • This might happen if we only get a reward for
    being spot on, and nothing for being close.
  • Compare soccer
  • you get nothing for hitting the post,
  • to shuffle-board close gets you points.

21
  • Arbitrary assumption We are entitled to believe
    things that have a 95 chance of being true.
  • It turns out we should believe that the
    population has 50 red marbles - the width of
    sample frequencies, the probabilities of which
    sum to 0.95.

22
  • Compare We are only entitled to believe things
    that have a 100 chance of being true.
  • Then you should believe that the population has
    50 red marbles - the width of sample
    frequencies, the probabilities of which sum to 1.
  • Or We are entitled to believe the hypothesis
    that is more likely, no matter how unlikely it
    might be.
  • Then you should believe that the population has
    50 red marbles - 0.

23
Sample of 10
P(f0.4 or 0.5 or 0.6) 0.20.250.2
0.65 P(f0.3 or 0.4 or 0.5 or 0.6 or 0.7)
0.120.20.250.20.12 0.89 P(f0.2 or 0.3 or
0.4 or 0.5 or 0.6 or 0.7 or 0.8)
0.040.120.20.250.20.120.04 0.97
  • P(f0) 0.001
  • P(f0.1) 0.01
  • P(f0.2) 0.04
  • P(f0.3) 0.12
  • P(f0.4) 0.20
  • P(f0.5) 0.25

picture
24
Sample of 10
  • If the frequency of red in the population is 50,
    then there is approximately a 95 chance the
    sample will have a frequency of red between 0.2
    and 0.8.
  • Therefore, if the frequency of red in the sample
    is 50, then there is approximately a 95 chance
    the population has a frequency between 0.2 and
    0.8.

25
Sample of 100
  • If the frequency of red in the population is 50,
    then there is approximately a 95 chance the
    sample will have a frequency of red between 0.4
    and 0.6.
  • Therefore, if the frequency of red in the sample
    is 50, then there is approximately a 95 chance
    the population has a frequency between 0.4 and
    0.6.

26
Rule-of-thumb margins of error for 95 certainty
27
Evaluating Distributions
  • Sample size of 250.
  • f(R) 0.56
  • f(G) 0.24
  • f(B) 0.20
  • The margin of error for 250 is - 0.06, so
  • P(R) 0.56 -0.06
  • P(G) 0.24 - 0.06
  • P(B) 0.20 - 0.06

28
Evaluating Correlations
  • Sample size 600 fig.6.3 bottom
  • 500 red, 100 non-red
  • Among the red, 325 / 500 are large, so f(LR)
    325/500 0.65
  • Among the non-red, 35/100 are large, so f(LN)
    35/100 0.35
  • Is this good evidence of a correlation between
    large and red?
  • Only if the confidence intervals dont overlap.

29
  • The margin of error for red depends on the number
    of red marbles in the sample
  • There are 500 red marbles, so -0.05.
  • f(LR) 0.65
  • P(LR) 0.65 - .05
  • So 0.6 to 0.7 of the red population are large.
  • There are 100 non-red marbles, so - 0.10 f(LN)
    0.35
  • P(LN) 0.35 -0.1
  • So 0.25 to 0.45 of the non-red population are
    large. fig. 6.3 whole

30
Lack of evidence for a correlation
  • Sample size 600 fig. 6.4 book
  • 500 red, 100 non-red
  • Among the red, 325 / 500 are large, so f(LR)
    325/500 0.65
  • P(LR) 0.65-0.05
  • So 0.6 to 0.7 of the red population are large.
    Among the non-red, 55/100 are large, so f(LN)
    55/100 0.55
  • P(LN) 0.55-0.01
  • So 0.45 to 0.65 of the red population are large.

31
Estimating the Strength of Correlation
  • The maximum allowed difference is between the top
    of the higher interval and the bottom of the
    lower interval.
  • The minimum allowed difference is between the
    bottom of the higher interval and the top of the
    lower interval.
  • Fig. 6.3, 0.7-0.250.45 and 0.60-0.450.15
  • Estimated strength of the correlation is (0.45,
    0.15)
  • Fig 6.4, 0.7-0.450.25 and 0.6-0.65
  • Estimated strength of the correlation is (0.25,
    -0.5)
  • The negative number indicates that there may be
    no correlation.

32
  • The standard deviation of the difference is less
    than the standard deviation of the difference.
  • This is because we are getting evidence from the
    whole sample of 600 marbles combined.
  • So rather than a certainty of 95, our estimate
    of the strength of correlation is 99 certain.

33
Statistical Significance
  • A correlation in the sample may be due to a
    correlation in the population, or it may be due
    to an accident of sampling.
  • A correlation is statistically significant iff it
    is unlikely to be an accident of sampling.
  • The sample frequencies are statistically
    significant iff the corresponding interval
    estimates do not overlap.
  • Iff the interval estimates do overlap, the
    differences in sample frequencies are not
    statistically significant.

34
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com