54
1 統統統 Fall 2003 授授授授 授授授授授授 授授2003 授 10 授 14 授 授授授 授授授授授

統計學 Fall 2003

Embed Size (px)

DESCRIPTION

統計學 Fall 2003. 授課教師:統計系余清祥 日期:2003年10月14日 第五週:機率論介紹. Chapter 4 Introduction to Probability. Experiments, Counting Rules, and Assigning Probabilities Events and Their Probability Some Basic Relationships of Probability Conditional Probability Bayes’ Theorem. - PowerPoint PPT Presentation

Citation preview

Page 1: 統計學          Fall 2003

1 1 Slide Slide

統計學 Fall 2003

授課教師:統計系余清祥 日期: 2003 年 10 月 14日

第五週:機率論介紹

Page 2: 統計學          Fall 2003

2 2 Slide Slide

Chapter 4Chapter 4 Introduction to Probability Introduction to Probability

Experiments, Counting Rules, and Experiments, Counting Rules, and

Assigning ProbabilitiesAssigning Probabilities Events and Their ProbabilityEvents and Their Probability Some Basic Relationships of ProbabilitySome Basic Relationships of Probability Conditional ProbabilityConditional Probability Bayes’ TheoremBayes’ Theorem

Page 3: 統計學          Fall 2003

3 3 Slide Slide

ProbabilityProbability

ProbabilityProbability is a numerical measure of the is a numerical measure of the likelihood that an event will occur.likelihood that an event will occur.

Probability values are always assigned on a Probability values are always assigned on a scale from 0 to 1.scale from 0 to 1.

A probability near 0 indicates an event is very A probability near 0 indicates an event is very unlikely to occur.unlikely to occur.

A probability near 1 indicates an event is A probability near 1 indicates an event is almost certain to occur.almost certain to occur.

A probability of 0.5 indicates the occurrence of A probability of 0.5 indicates the occurrence of the event is just as likely as it is unlikely.the event is just as likely as it is unlikely.

Page 4: 統計學          Fall 2003

4 4 Slide Slide

Probability as a Numerical MeasureProbability as a Numerical Measureof the Likelihood of Occurrenceof the Likelihood of Occurrence

00 11.5.5

Increasing Likelihood of OccurrenceIncreasing Likelihood of Occurrence

ProbabilitProbability:y:

The occurrence of the The occurrence of the event isevent is

just as likely as it is just as likely as it is unlikely.unlikely.

Page 5: 統計學          Fall 2003

5 5 Slide Slide

An Experiment and Its Sample SpaceAn Experiment and Its Sample Space

An An experimentexperiment is any process that generates is any process that generates well-defined outcomes.well-defined outcomes.

The The sample spacesample space for an experiment is the set for an experiment is the set of all experimental outcomes.of all experimental outcomes.

A A sample pointsample point is an element of the sample is an element of the sample space, any one particular experimental space, any one particular experimental outcome.outcome.

Page 6: 統計學          Fall 2003

6 6 Slide Slide

Example: Bradley InvestmentsExample: Bradley Investments

Bradley has invested in two stocks, Markley Oil and Bradley has invested in two stocks, Markley Oil and

Collins Mining. Bradley has determined that theCollins Mining. Bradley has determined that the

possible outcomes of these investments three possible outcomes of these investments three monthsmonths

from now are as follows.from now are as follows.

Investment Gain or LossInvestment Gain or Loss

in 3 Months (in $000)in 3 Months (in $000)

Markley OilMarkley Oil Collins MiningCollins Mining

1010 8 8

55 -2 -2

00

-20-20

Page 7: 統計學          Fall 2003

7 7 Slide Slide

A Counting Rule for A Counting Rule for Multiple-Step ExperimentsMultiple-Step Experiments

If an experiment consists of a sequence of If an experiment consists of a sequence of kk steps in which there are steps in which there are nn11 possible results for possible results for the first step, the first step, nn22 possible results for the second possible results for the second step, and so on, then the total number of step, and so on, then the total number of experimental outcomes is given by (experimental outcomes is given by (nn11)()(nn22) . . . ) . . . ((nnkk).).

A helpful graphical representation of a A helpful graphical representation of a multiple-step experiment is a multiple-step experiment is a tree diagramtree diagram..

Page 8: 統計學          Fall 2003

8 8 Slide Slide

Example: Bradley InvestmentsExample: Bradley Investments

A Counting Rule for Multiple-Step ExperimentsA Counting Rule for Multiple-Step Experiments

Bradley Investments can be viewed as a two-Bradley Investments can be viewed as a two-step experiment; it involves two stocks, each step experiment; it involves two stocks, each with a set of experimental outcomes.with a set of experimental outcomes.

Markley Oil:Markley Oil: nn11 = 4 = 4

Collins Mining:Collins Mining: nn22 = 2 = 2

Total Number of Total Number of

Experimental Outcomes:Experimental Outcomes: nn11nn22 = (4) = (4)(2) = 8(2) = 8

Page 9: 統計學          Fall 2003

9 9 Slide Slide

Example: Bradley InvestmentsExample: Bradley Investments

Tree DiagramTree Diagram

Markley Oil Collins Mining Markley Oil Collins Mining ExperimentalExperimental (Stage 1)(Stage 1) (Stage 2) (Stage 2) Outcomes Outcomes

Gain 5Gain 5

Gain 8Gain 8

Gain 8Gain 8

Gain 10Gain 10

Gain 8Gain 8

Gain 8Gain 8

Lose 20Lose 20

Lose 2Lose 2

Lose 2Lose 2

Lose 2Lose 2

Lose 2Lose 2

EvenEven

(10, 8) (10, 8) Gain Gain $18,000$18,000

(10, -2) (10, -2) Gain Gain $8,000 $8,000

(5, 8) (5, 8) Gain Gain $13,000$13,000

(5, -2) (5, -2) Gain Gain $3,000 $3,000

(0, 8) (0, 8) Gain Gain $8,000 $8,000

(0, -2) (0, -2) Lose Lose $2,000 $2,000

(-20, 8) (-20, 8) Lose Lose $12,000$12,000

(-20, -2)(-20, -2) Lose Lose $22,000$22,000

Page 10: 統計學          Fall 2003

10 10 Slide Slide

Another useful counting rule enables us to count theAnother useful counting rule enables us to count the

number of experimental outcomes when number of experimental outcomes when nn objects objects are toare to

be selected from a set of be selected from a set of NN objects. objects. Number of combinations of Number of combinations of NN objects taken objects taken nn at a at a

timetime

wherewhere NN! = ! = NN((NN - 1)( - 1)(NN - 2) . . . (2)(1) - 2) . . . (2)(1)

nn! = ! = nn((nn - 1)( - 1)( nn - 2) . . . (2)(1) - 2) . . . (2)(1)

0! = 10! = 1

Counting Rule for CombinationsCounting Rule for Combinations

CN

nN

n N nnN

!

!( )!C

N

nN

n N nnN

!

!( )!

Page 11: 統計學          Fall 2003

11 11 Slide Slide

Counting Rule for PermutationsCounting Rule for Permutations

A third useful counting rule enables us to count A third useful counting rule enables us to count thethe

number of experimental outcomes when number of experimental outcomes when nn objects are toobjects are to

be selected from a set of be selected from a set of NN objects where the objects where the order oforder of

selection is important.selection is important. Number of permutations of Number of permutations of NN objects taken objects taken nn

at a timeat a time

P nN

nN

N nnN

!!

( )!P n

N

nN

N nnN

!!

( )!

Page 12: 統計學          Fall 2003

12 12 Slide Slide

Assigning ProbabilitiesAssigning Probabilities

Classical MethodClassical Method

Assigning probabilities based on the Assigning probabilities based on the assumption of assumption of equally likely outcomesequally likely outcomes..

Relative Frequency MethodRelative Frequency Method

Assigning probabilities based on Assigning probabilities based on experimentation or historical dataexperimentation or historical data..

Subjective MethodSubjective Method

Assigning probabilities based on the Assigning probabilities based on the assignor’s judgmentassignor’s judgment..

Page 13: 統計學          Fall 2003

13 13 Slide Slide

Classical MethodClassical Method

If an experiment has If an experiment has nn possible outcomes, this possible outcomes, this method method

would assign a probability of 1/would assign a probability of 1/nn to each to each outcome.outcome.

ExampleExample

Experiment: Rolling a dieExperiment: Rolling a die

Sample Space: Sample Space: SS = {1, 2, 3, 4, 5, 6} = {1, 2, 3, 4, 5, 6}

Probabilities: Each sample point has a 1/6 Probabilities: Each sample point has a 1/6 chancechance

of occurring.of occurring.

Page 14: 統計學          Fall 2003

14 14 Slide Slide

Example: Lucas Tool RentalExample: Lucas Tool Rental

Relative Frequency MethodRelative Frequency Method

Lucas would like to assign probabilities to theLucas would like to assign probabilities to the

number of floor polishers it rents per day. Officenumber of floor polishers it rents per day. Office

records show the following frequencies of daily records show the following frequencies of daily rentalsrentals

for the last 40 days.for the last 40 days.

Number ofNumber of Number Number Polishers RentedPolishers Rented of Daysof Days

00 4 411 6 622 18 1833 10 1044 2 2

Page 15: 統計學          Fall 2003

15 15 Slide Slide

Relative Frequency MethodRelative Frequency Method

The probability assignments are given by dividing The probability assignments are given by dividing

the number-of-days frequencies by the total frequencythe number-of-days frequencies by the total frequency

(total number of days).(total number of days).

Number of NumberNumber of NumberPolishers RentedPolishers Rented of Daysof Days ProbabilityProbability

00 4 4 .10 .10 = 4/40= 4/40 11 6 6 .15 .15 = 6/40= 6/40 22 18 18 .45 .45 etc.etc. 33 10 10 .25 .25 44 2 2 .05.05

4040 1.001.00

Example: Lucas Tool RentalExample: Lucas Tool Rental

Page 16: 統計學          Fall 2003

16 16 Slide Slide

Subjective MethodSubjective Method

When economic conditions and a company’s When economic conditions and a company’s circumstances change rapidly it might be circumstances change rapidly it might be inappropriate to assign probabilities based inappropriate to assign probabilities based solely on historical data.solely on historical data.

We can use any data available as well as our We can use any data available as well as our experience and intuition, but ultimately a experience and intuition, but ultimately a probability value should express our probability value should express our degree of degree of beliefbelief that the experimental outcome will occur. that the experimental outcome will occur.

The best probability estimates often are The best probability estimates often are obtained by combining the estimates from the obtained by combining the estimates from the classical or relative frequency approach with classical or relative frequency approach with the subjective estimates. the subjective estimates.

Page 17: 統計學          Fall 2003

17 17 Slide Slide

Example: Bradley InvestmentsExample: Bradley Investments

Applying the subjective method, an analyst Applying the subjective method, an analyst

made the following probability assignments.made the following probability assignments.

Exper. OutcomeExper. Outcome Net Gain/LossNet Gain/Loss ProbabilityProbability ( 10, 8)( 10, 8) $18,000 $18,000 GainGain .20 .20 ( 10, -2) $8,000( 10, -2) $8,000 GainGain .08 .08 ( 5, 8) $13,000( 5, 8) $13,000 GainGain .16 .16 ( 5, -2) $3,000( 5, -2) $3,000 GainGain .26 .26 ( 0, 8) ( 0, 8) $8,000 $8,000 GainGain .10 .10 ( 0, -2) ( 0, -2) $2,000 $2,000 LossLoss .12 .12 (-20, 8) (-20, 8) $12,000 $12,000 LossLoss .02 .02 (-20, -2) (-20, -2) $22,000 $22,000 LossLoss .06 .06

Page 18: 統計學          Fall 2003

18 18 Slide Slide

Events and Their ProbabilityEvents and Their Probability

An An eventevent is a collection of sample points.is a collection of sample points. The The probability of any eventprobability of any event is equal to the is equal to the

sum of the probabilities of the sample points in sum of the probabilities of the sample points in the event.the event.

If we can identify all the sample points of an If we can identify all the sample points of an experiment and assign a probability to each, experiment and assign a probability to each, we can compute the probability of an event.we can compute the probability of an event.

Page 19: 統計學          Fall 2003

19 19 Slide Slide

Example: Bradley InvestmentsExample: Bradley Investments

Events and Their ProbabilitiesEvents and Their Probabilities

Event Event MM = Markley Oil Profitable = Markley Oil Profitable

MM = {(10, 8), (10, -2), (5, 8), (5, - = {(10, 8), (10, -2), (5, 8), (5, -2)}2)}

P(P(MM) = P(10, 8) + P(10, -2) + P(5, 8) ) = P(10, 8) + P(10, -2) + P(5, 8) + P(5, -2)+ P(5, -2)

= .2 + .08 + .16 + .26= .2 + .08 + .16 + .26

= .70= .70

EventEvent C C = Collins Mining Profitable= Collins Mining Profitable

P(P(CC) =) = .48.48 (found using the same (found using the same logic)logic)

Page 20: 統計學          Fall 2003

20 20 Slide Slide

Some Basic Relationships of ProbabilitySome Basic Relationships of Probability

There are some There are some basic probability relationshipsbasic probability relationships that can be used to compute the probability of that can be used to compute the probability of an event without knowledge of al the sample an event without knowledge of al the sample point probabilities.point probabilities.

• Complement of an EventComplement of an Event

• Union of Two EventsUnion of Two Events

• Intersection of Two EventsIntersection of Two Events

• Mutually Exclusive EventsMutually Exclusive Events

Page 21: 統計學          Fall 2003

21 21 Slide Slide

Complement of an EventComplement of an Event

The The complementcomplement of event of event A A is defined to be is defined to be the event consisting of all sample points that the event consisting of all sample points that are not in are not in A.A.

The complement of The complement of AA is denoted by is denoted by AAcc.. The The Venn diagramVenn diagram below illustrates the below illustrates the

concept of a complement.concept of a complement.

Event Event AA AAcc

Sample Space SSample Space S

Page 22: 統計學          Fall 2003

22 22 Slide Slide

The The unionunion of events of events AA and and BB is the event is the event containing all sample points that are in containing all sample points that are in A A oror B B or both.or both.

The union is denoted by The union is denoted by AA BB The union of The union of AA and and BB is illustrated below. is illustrated below.

Sample Space SSample Space S

Event Event AA Event Event BB

Union of Two EventsUnion of Two Events

Page 23: 統計學          Fall 2003

23 23 Slide Slide

Example: Bradley InvestmentsExample: Bradley Investments

Union of Two EventsUnion of Two Events

Event Event MM = Markley Oil Profitable = Markley Oil Profitable

Event Event CC = Collins Mining = Collins Mining ProfitableProfitable

MM CC = Markley Oil Profitable = Markley Oil Profitable

oror Collins Mining Profitable Collins Mining Profitable

MM CC = {(10, 8), (10, -2), (5, 8), (5, -2), (0, 8), = {(10, 8), (10, -2), (5, 8), (5, -2), (0, 8), (-20, 8)}(-20, 8)}

P(P(MM C)C) = = P(10, 8) + P(10, -2) + P(5, 8) + P(5, -2)P(10, 8) + P(10, -2) + P(5, 8) + P(5, -2)

+ P(0, 8) + P(-20, 8)+ P(0, 8) + P(-20, 8)

= .20 + .08 + .16 + .26 + .10 + .02= .20 + .08 + .16 + .26 + .10 + .02

= .82 = .82

Page 24: 統計學          Fall 2003

24 24 Slide Slide

Intersection of Two EventsIntersection of Two Events

The The intersectionintersection of events of events AA and and BB is the set of is the set of all sample points that are in bothall sample points that are in both A A and and BB..

The intersection is denoted by The intersection is denoted by AA The intersection of The intersection of AA and and BB is the area of is the area of

overlap in the illustration below.overlap in the illustration below.

Sample Space SSample Space S

Event Event AA Event Event BB

IntersectionIntersection

Page 25: 統計學          Fall 2003

25 25 Slide Slide

Intersection of Two EventsIntersection of Two Events

Event Event MM = Markley Oil Profitable = Markley Oil Profitable

Event Event CC = Collins Mining = Collins Mining ProfitableProfitable

MM CC = Markley Oil Profitable = Markley Oil Profitable

andand Collins Mining Profitable Collins Mining Profitable

MM CC = {(10, 8), (5, 8)} = {(10, 8), (5, 8)}

P(P(MM C)C) = = P(10, 8) + P(5, 8)P(10, 8) + P(5, 8)

= .20 + .16= .20 + .16

= .36= .36

Example: Bradley InvestmentsExample: Bradley Investments

Page 26: 統計學          Fall 2003

26 26 Slide Slide

Addition LawAddition Law

The The addition lawaddition law provides a way to compute provides a way to compute the probability of event the probability of event A,A, or or B,B, or both or both AA and and B B occurring.occurring.

The law is written as: The law is written as:

P(P(AA BB) = P() = P(AA) + P() + P(BB) - P() - P(AA BB

Page 27: 統計學          Fall 2003

27 27 Slide Slide

Example: Bradley InvestmentsExample: Bradley Investments

Addition LawAddition Law

Markley Oil Markley Oil oror Collins Mining Profitable Collins Mining Profitable

We know: P(We know: P(MM) = .70, P() = .70, P(CC) = .48, P() = .48, P(MM CC) ) = .36= .36

Thus: P(Thus: P(MM C) C) = P(= P(MM) + P() + P(CC) - P() - P(MM CC))

= .70 + .48 - .36= .70 + .48 - .36

= .82 = .82

This result is the same as that obtained This result is the same as that obtained earlier usingearlier using

the definition of the probability of an event.the definition of the probability of an event.

Page 28: 統計學          Fall 2003

28 28 Slide Slide

Mutually Exclusive EventsMutually Exclusive Events

Two events are said to be Two events are said to be mutually exclusivemutually exclusive if if the events have no sample points in common. the events have no sample points in common. That is, two events are mutually exclusive if, That is, two events are mutually exclusive if, when one event occurs, the other cannot when one event occurs, the other cannot occur.occur. Sample

Space SSample Space S

Event Event BBEvent Event AA

Page 29: 統計學          Fall 2003

29 29 Slide Slide

Mutually Exclusive EventsMutually Exclusive Events

Addition Law for Mutually Exclusive EventsAddition Law for Mutually Exclusive Events

P(P(AA BB) = P() = P(AA) + P() + P(BB) )

Page 30: 統計學          Fall 2003

30 30 Slide Slide

Conditional ProbabilityConditional Probability

The probability of an event given that another The probability of an event given that another event has occurred is called a event has occurred is called a conditional conditional probabilityprobability..

The conditional probability of The conditional probability of AA given given BB is is denoted by P(denoted by P(AA||BB).).

A conditional probability is computed as A conditional probability is computed as follows:follows: P

PP

( | )( )

( )A B

A BB

PP

P( | )

( )( )

A BA BB

Page 31: 統計學          Fall 2003

31 31 Slide Slide

Example: Bradley InvestmentsExample: Bradley Investments

Conditional ProbabilityConditional Probability

Collins Mining Profitable Collins Mining Profitable given given

Markley Oil ProfitableMarkley Oil Profitable

PP

P( | )

( )( )

.

..C M

C MM

3670

51PP

P( | )

( )( )

.

..C M

C MM

3670

51

Page 32: 統計學          Fall 2003

32 32 Slide Slide

Multiplication LawMultiplication Law

The The multiplication lawmultiplication law provides a way to provides a way to compute the probability of an intersection of compute the probability of an intersection of two events.two events.

The law is written as: The law is written as:

P(P(AA BB) = P() = P(BB)P()P(AA||BB))

Page 33: 統計學          Fall 2003

33 33 Slide Slide

Example: Bradley InvestmentsExample: Bradley Investments

Multiplication LawMultiplication Law

Markley Oil Markley Oil andand Collins Mining Profitable Collins Mining Profitable

We know: P(We know: P(MM) = .70, P() = .70, P(CC||MM) = .51) = .51

Thus: P(Thus: P(MM C) C) = P(= P(MM)P()P(M|CM|C))

= (.70)(.51)= (.70)(.51)

= .36 = .36

This result is the same as that obtained This result is the same as that obtained earlier using the definition of the probability of earlier using the definition of the probability of an event.an event.

Page 34: 統計學          Fall 2003

34 34 Slide Slide

Independent EventsIndependent Events

Events Events AA and and BB are are independentindependent if P( if P(AA||BB) = ) = P(P(AA).).

Page 35: 統計學          Fall 2003

35 35 Slide Slide

Independent EventsIndependent Events

Multiplication Law for Independent EventsMultiplication Law for Independent Events

P(P(AA BB) = P() = P(AA)P()P(BB))

The multiplication law also can be used as a The multiplication law also can be used as a test to see if two events are independent.test to see if two events are independent.

Page 36: 統計學          Fall 2003

36 36 Slide Slide

Example: Bradley InvestmentsExample: Bradley Investments

Multiplication Law for Independent EventsMultiplication Law for Independent Events

Are Are MM and and CC independent? independent?

DoesDoesP(P(MM CC) = P() = P(M)P(C) M)P(C) ??

We know: P(We know: P(MM CC) = .36, P() = .36, P(MM) = .70, P() = .70, P(CC) ) = .48= .48

But: P(But: P(M)P(C) M)P(C) = (.70)(.48) = .34= (.70)(.48) = .34

.34.34sosoMM and and CC are are notnot independent.independent.

Page 37: 統計學          Fall 2003

37 37 Slide Slide

Bayes’ TheoremBayes’ Theorem

Often we begin probability analysis with initial Often we begin probability analysis with initial or or prior probabilitiesprior probabilities..

Then, from a sample, special report, or a Then, from a sample, special report, or a product test we obtain some additional product test we obtain some additional information.information.

Given this information, we calculate revised or Given this information, we calculate revised or posterior probabilitiesposterior probabilities..

Bayes’ theoremBayes’ theorem provides the means for provides the means for revising the prior probabilities.revising the prior probabilities.

NewNewInformationInformation

NewNewInformationInformation

ApplicationApplicationof Bayes’of Bayes’TheoremTheorem

ApplicationApplicationof Bayes’of Bayes’TheoremTheorem

PosteriorPosteriorProbabilitiesProbabilities

PosteriorPosteriorProbabilitiesProbabilities

PriorPriorProbabilitiesProbabilities

PriorPriorProbabilitiesProbabilities

Page 38: 統計學          Fall 2003

38 38 Slide Slide

A proposed shopping center will provide strong A proposed shopping center will provide strong competition for downtown businesses like L. S. competition for downtown businesses like L. S. Clothiers. If the shopping center is built, the owner of L. Clothiers. If the shopping center is built, the owner of L. S. Clothiers feels it would be best to relocate. S. Clothiers feels it would be best to relocate.

The shopping center cannot be built unless a The shopping center cannot be built unless a zoning change is approved by the town council. The zoning change is approved by the town council. The planning board must first make a recommendation, for planning board must first make a recommendation, for or against the zoning change, to the council. Let: or against the zoning change, to the council. Let:

AA11 = town council approves the zoning change = town council approves the zoning change

AA22 = town council disapproves the change = town council disapproves the change Prior ProbabilitiesPrior Probabilities

Using subjective judgment: P(Using subjective judgment: P(AA11) = .7, P() = .7, P(AA22) = .3) = .3

Example: L. S. ClothiersExample: L. S. Clothiers

Page 39: 統計學          Fall 2003

39 39 Slide Slide

Example: L. S. ClothiersExample: L. S. Clothiers

New InformationNew Information

The planning board has recommended The planning board has recommended against against the zoning change. Let the zoning change. Let BB denote the event of a denote the event of a negative recommendation by the planning negative recommendation by the planning board.board.

Given that Given that BB has occurred, should L. S. has occurred, should L. S. Clothiers revise the probabilities that the town Clothiers revise the probabilities that the town council will approve or disapprove the zoning council will approve or disapprove the zoning change?change?

Conditional ProbabilitiesConditional Probabilities

Past history with the planning board and the Past history with the planning board and the town council indicates the following:town council indicates the following:

P(P(BB||AA11) = .2 P() = .2 P(BB||AA22) = .9) = .9

Page 40: 統計學          Fall 2003

40 40 Slide Slide

Tree DiagramTree Diagram

Example: L. S. ClothiersExample: L. S. Clothiers

P(Bc|A1) = .8P(Bc|A1) = .8

P(A1) = .7P(A1) = .7

P(A2) = .3P(A2) = .3

P(B|A2) = .9P(B|A2) = .9

P(Bc|A2) = .1P(Bc|A2) = .1

P(B|A1) = .2P(B|A1) = .2 P(A1 B) = .14P(A1 B) = .14

P(A2 B) = .27P(A2 B) = .27

P(A2 Bc) = .03P(A2 Bc) = .03

P(A1 Bc) = .56P(A1 Bc) = .56

Page 41: 統計學          Fall 2003

41 41 Slide Slide

Bayes’ TheoremBayes’ Theorem

To find the posterior probability that event To find the posterior probability that event AAii will occur given that eventwill occur given that event B B has occurred we has occurred we apply apply Bayes’ theoremBayes’ theorem..

Bayes’ theorem is applicable when the events Bayes’ theorem is applicable when the events for which we want to compute posterior for which we want to compute posterior probabilities are mutually exclusive and their probabilities are mutually exclusive and their union is the entire sample space.union is the entire sample space.

P A BA B A

A B A A B A A B Aii i

n n

( | )( ) ( | )

( ) ( | ) ( ) ( | ) ... ( ) ( | )

P P

P P P P P P1 1 2 2

P A BA B A

A B A A B A A B Aii i

n n

( | )( ) ( | )

( ) ( | ) ( ) ( | ) ... ( ) ( | )

P P

P P P P P P1 1 2 2

Page 42: 統計學          Fall 2003

42 42 Slide Slide

Example: L. S. ClothiersExample: L. S. Clothiers

Posterior ProbabilitiesPosterior Probabilities

Given the planning board’s recommendation Given the planning board’s recommendation not to approve the zoning change, we revise not to approve the zoning change, we revise the prior probabilities as follows.the prior probabilities as follows.

= .34= .34 ConclusionConclusion

The planning board’s recommendation is good The planning board’s recommendation is good news for L. S. Clothiers. The posterior news for L. S. Clothiers. The posterior probability of the town council approving the probability of the town council approving the zoning change is .34 versus a prior probability zoning change is .34 versus a prior probability of .70.of .70.

P A BA B A

A B A A B A( | )

( ) ( | )( ) ( | ) ( ) ( | )1

1 1

1 1 2 2

P PP P P P

P A BA B A

A B A A B A( | )

( ) ( | )( ) ( | ) ( ) ( | )1

1 1

1 1 2 2

P PP P P P

(. )(. )(. )(. ) (. )(. )

7 27 2 3 9

(. )(. )(. )(. ) (. )(. )

7 27 2 3 9

Page 43: 統計學          Fall 2003

43 43 Slide Slide

Tabular ApproachTabular Approach

Step 1Step 1 Prepare the following three columns: Prepare the following three columns:

Column 1Column 1 - The mutually exclusive events for - The mutually exclusive events for which posterior probabilities are desired.which posterior probabilities are desired.

Column 2Column 2 - The prior probabilities for the - The prior probabilities for the events.events.

Column 3Column 3 - The conditional probabilities of - The conditional probabilities of the new information the new information givengiven each event. each event.

Page 44: 統計學          Fall 2003

44 44 Slide Slide

Tabular ApproachTabular Approach

(1)(1) (2) (2) (3) (3) (4) (4) (5) (5) PriorPrior Conditional Conditional

EventsEvents Probabilities ProbabilitiesProbabilities Probabilities

AAii PP((AAii)) PP((BB||AAii))

AA11 .7.7 .2.2

AA22 .3.3 .9.9

1.0

Page 45: 統計學          Fall 2003

45 45 Slide Slide

Tabular ApproachTabular Approach

Step 2Step 2 In column 4, compute the joint In column 4, compute the joint probabilities for each event and the new probabilities for each event and the new information information BB by using the multiplication law. by using the multiplication law.

Multiply the prior probabilities in Multiply the prior probabilities in column 2 by the corresponding conditional column 2 by the corresponding conditional probabilities in column 3. That is, probabilities in column 3. That is, PP((AAi i BB) = ) = PP((AAii) ) PP((BB||AAii). ).

Page 46: 統計學          Fall 2003

46 46 Slide Slide

Tabular ApproachTabular Approach

(1)(1) (2) (2) (3) (3) (4) (4) (5) (5) PriorPrior Conditional Joint Conditional Joint

EventsEvents Probabilities Probabilities ProbabilitiesProbabilities Probabilities Probabilities

AAii PP((AAii)) PP((BB||AAii) ) PP((AAi i BB))

AA11 .7.7 .2.2 .14 .14

AA22 .3.3 .9.9 .27 .27

1.0

Page 47: 統計學          Fall 2003

47 47 Slide Slide

Tabular ApproachTabular Approach

Step 3Step 3 Sum the joint probabilities in column 4. Sum the joint probabilities in column 4. The sum is the probability of the new The sum is the probability of the new information information PP((BB).).

We see that there is a .14 probability We see that there is a .14 probability of the town council approving the zoning change of the town council approving the zoning change and a negative recommendation by the planning and a negative recommendation by the planning board. There is a .27 probability of the town board. There is a .27 probability of the town council disapproving the zoning change and a council disapproving the zoning change and a negative recommendation by the planning negative recommendation by the planning board. board.

The sum .14 + .27 shows an overall The sum .14 + .27 shows an overall probability of .41 of a negative recommendation probability of .41 of a negative recommendation by the planning board. by the planning board.

Page 48: 統計學          Fall 2003

48 48 Slide Slide

Tabular ApproachTabular Approach

(1)(1) (2) (2) (3) (3) (4) (4) (5) (5) PriorPrior Conditional Joint Conditional Joint

EventsEvents Probabilities Probabilities ProbabilitiesProbabilities Probabilities Probabilities

AAii PP((AAii)) PP((BB||AAii) ) PP((AAi i BB))

AA11 .7.7 .2.2 .14 .14

AA22 .3.3 .9.9 .27.27

1.01.0 PP((BB) = .41) = .41

Page 49: 統計學          Fall 2003

49 49 Slide Slide

Step 4Step 4 In column 5, compute the posterior In column 5, compute the posterior probabilities using the basic relationship of probabilities using the basic relationship of conditional probability.conditional probability.

Note that the joint probabilities Note that the joint probabilities PP((AAi i BB) are ) are in column 4 and the probability in column 4 and the probability PP((BB) is the sum of ) is the sum of column 4.column 4.

Tabular ApproachTabular Approach

)(

)()|(

BP

BAPBAP i

i

)(

)()|(

BP

BAPBAP i

i

Page 50: 統計學          Fall 2003

50 50 Slide Slide

Tabular ApproachTabular Approach

(1)(1) (2) (2) (3) (3) (4) (4) (5) (5) PriorPrior Conditional Joint Conditional Joint Posterior Posterior

EventsEvents Probabilities Probabilities Probabilities Probabilities Probabilities Probabilities ProbabilitiesProbabilities

AAii PP((AAii)) PP((BB||AAii) ) PP((AAi i BB) ) PP((AAii ||BB) )

AA11 .7.7 .2.2 .14 .14 .3415 .3415

AA22 .3.3 .9.9 .27.27 .6585.6585

1.01.0 PP((BB) = .41) = .41 1.00001.0000

Page 51: 統計學          Fall 2003

51 51 Slide Slide

A patient takes a lab test and the result comes back positive. The test returns a correct positive result in 99% of the cases in which the disease is actually present, and a correct negative result in 98% of the cases in which the disease is not present. Furthermore, .001 of all people have this cancer.

貝氏定理可協助我們更理性的判斷

= .047P(cancer | +) =)(

)()|(

P

cancerPcancerP

P ~cancer) =.02

.999P(~ cancer) =.001P(cancer) =

.01P cancer) =.99P(+ | ~cancer) = .98P(+ | cancer) =

Page 52: 統計學          Fall 2003

52 52 Slide Slide

計算細節:計算細節: 假設某地區有一百萬人:假設某地區有一百萬人:

999,000999,000 人健康,人健康, 1,0001,000 人罹患癌症人罹患癌症 檢查出陽性反應者:檢查出陽性反應者:(1)(1) 健康者中有健康者中有(2) (2) 癌症患者中有癌症患者中有

因此,癌症患者佔陽性反應者的比例:因此,癌症患者佔陽性反應者的比例:

980,19%2000,999 990%99000,1

%72.4970,20

990

990980,19

990)|(

cancerP

Page 53: 統計學          Fall 2003

53 53 Slide Slide

Suppose a second test for the same patient returns a positive result as well. What are the posterior probabilities for cancer?

P ~cancer) =.02

.999P(~cancer) =.001P(cancer) =

.01P cancer) =.99

P(+ | ~cancer) = .98

P(+ | cancer) =

= .710P(cancer | +1+2) = )(

)()|(

21

21

P

cancerPcancerP

Page 54: 統計學          Fall 2003

54 54 Slide Slide

End of Chapter 4End of Chapter 4