機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

32
機機 SOME BASIC PROBABILITY CONCEPTS 機機機機機機機機機機機機 機機機

Transcript of 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

Page 1: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

機率 SOME BASIC

PROBABILITY CONCEPTS

台北醫學大學公共衛生學系葉錦瑩

Page 2: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

機率的基本觀念 •集合 (set;S) 是由許多元素 (elements;

s) 構成。– 若 x = X(s)

• S = {1,2,3,4,5}• A = {1,2,3}• B = {2,3,4}

– 則 x : random variable• 5⊂S: 唸成 '5 belong to S' 表示 5 是 S 的元素 (element) 。• A⊂S: 唸成 'A include in S' 表示 A 是 S 的部份集合

(subset) 。• A = {4,5} 表示是 A 的餘集合 (complement; A* ) 。• C = {} 表示 C 是空集合 (empty set; null set;φ) 。• A∪B = {1,2,3,4} : 唸成 'A union B' 表示 A 與 B 的聯集合。• A∩B = {2,3} : 唸成 'A intersection B' 表示 A 與 B 的

交集合。

Page 3: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

機率的基本觀念 • 實驗 (Random Experiment):any planned process

of data collection, which consists of a number of independent trials under the same condition.

• 樣本空間 (Sample Space; Outcome Space; N):the collection of all possible different outcomes in a experiment.

• 樣本點 (Sample Point): any possible outcome in the sample space.

• 事件 (Event):a single outcome 或 a set of outcomes.

• 機率 (Probability):sample points of an event (A) in a sample space (N).

Page 4: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

Definition• If an event can occur in N

mutually exclusive and equally likely ways, and if m of these possess a trait, E, the probability of the occurrence of E is equal to m/N.

P(E) = m / N

Page 5: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

The subjects in the study by Erickson and Murray consisted of a sample of 75 men and 36 women. Table 3.4.1 shows the lifetime frequency of cocaine use and the gender of these subjects.

Page 6: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

P(M) = number of males / total number of subjects

= 75 / 111 = .6757

•What is the probability that this person will be a male?

Page 7: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

機率的基本觀念

• 機率的獲得 – 理論機率 (Theoretical Probability; 事先機率 ,Priority Probability): the frequency distribution for all the measurements in the entire population.

– 經驗機率 (Empirical Probability): a frequency distribution is tabulated from a set of sample measurement.

– 主觀機率 (Subjective Probability)

Page 8: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

機率運算法則 • 加法法則 (Addition rule)

– Pr(A or B) = Pr(A) + Pr(B) - Pr(A and B) i.e. Pr(A∪B) = Pr(A) + Pr(B) - Pr(A∩B) if A and B are mutually exclusive (互斥) then : Pr(A∪B) = Pr(A) + Pr(B)

• 乘法法則 (Multiplication rule) – 兩個或兩個以上事件聯合發生時,稱為組合機率 (joint

probability or compound probability) 。 Pr(A∩B) = Pr(A) ×Pr(B│A) = Pr(B) ×Pr(A│B) but A and B are independent (獨立) if and only

if : Pr(A∩B) = Pr(A) ×Pr(B)

Page 9: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

Example 3.4.2

• Suppose we pick a subject at random from the 111 subjects and find that he is a male (M). What is the probability that this male will be one who has used cocaine 100 times or more during his lifetime (C)?

P(C\M) = 25 / 75 = .33

Page 10: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

Example 3.4.3

• Let us refer again to Table 3.4.1. What is the probability that a person picked at random from the 111 subjects will be a male (M) and be a person who has used cocaine 100 times or more during his lifetime (C)?

P (M∩C) = 25 / 111 = .2252

Page 11: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

Example 3.4.4

• We wish to compute the joint probability of male (M) and a lifetime frequency of cocaine use of 100 times or more (C) from a knowledge of an appropriate marginal probability and an appropriate conditional probability.

P(M) = 75 / 111 = .6757 P(C\M) = 25 / 75 = .3333

P(M∩C) = P(M) P(C\M) = (.6757)(.3333) = .2252

Page 12: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

條件機率(Conditional Probability; Posterior

Probability) Pr(B│A) = [N(A and B)/N]/[N(A)/N]

= Pr(A∩B)/Pr(A) = [Pr(A│B) ×Pr(B)]/Pr(A)

Where:

Pr(A│B) 0 ,Pr(B│B)≧ = 1

Pr(A1 A2 …│B) ∪ ∪= Pr(A1│B) + Pr(A2│B)

… + [ Ai∩Aj = φ,i≠j ] but Pr(A) = ΣPr(A│Bj) × Pr(Bj)

so Pr(Bi│A) = [Pr(A│Bi ) × Pr(Bi)]∕[ΣPr(A│Bj) ×Pr(Bj)]

That is the “ Bayes' theorem".

Page 13: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

Definition

• The conditional probability of A given B is equal to the probability of A∩B divided by the probability of B, provided the probability of B is not zero.

P(A\B) = P(A∩B) / P(B), where P(B)≠0

Page 14: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

Example 3.4.5

• We wish to use the following equation to find the conditional probability, P(C│M).

P(C\M) = P(C∩M) / P(M)

= (25/111) / (75/111) = 25/ 75

Page 15: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

Definition

• Given two events A and B, the probability that event A, or event B, or both occur is equal to the probability that event A occurs, plus the probability that event B occurs, minus the probability that the events occur simultaneously.

P(A B) = P(A)∪ + P(B) - P(A∩B)

Page 16: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

P(M C) = P(M)∪ + P(C) - P(M∩C)

P(M) = 75 / 111 = .6757 P(M∩C) = 25 / 111 = .2252

P(C) = 34 / 111 = .3063 P(M C) = .6757∪ + .3063 - .2252 = .7568

• If we select a person at random from the 111 subjects, what is the probability that this person will be a male (M) or will have used cocaine 100 times or more during his lifetime (C) or both ?

Page 17: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

• In a certain high school class, consisting of 60 girls and 40 boys, it is observed that 24 girls and 16 boys wear eyeglasses. If a student is picked at random from this class, the probability that the student wears eyeglasses, P(E), is 40/100, or .4.– What is the probability that a student picked

at random wears eyeglasses, given that the student is a boy?

P(E\B) = P(E∩B)/P(B) = (16/100)/(40/100) = .4

P(E\B) = P(E∩B)/P(B) = (24/100)/(60/100) = 24/60 = .4

Example 3.4.7

eyeglass girl boy total

yes 24 16 40no 36 24 60

total 60 40 100

Page 18: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

Example 3.4.7

• What is the probability of the joint occurrence of the events of wearing eyeglasses and being a boy?

P(E∩B) = P(B)P(E\B)

P(E∩B) = P(B)P(E) = (40/100)(40/100) = .16

eyeglass girl boy total

yes 24 16 40no 36 24 60

total 60 40 100

Page 19: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

Example 3.4.8

• Suppose that of 1200 admissions to a general hospital during a certain period of time, 750 are private admissions. If we designate these as set A, then A is equal to 1200 minus 750, or 450. We may compute

P(A) = 750/1200 = .625

P(A) = 450/1200 = .375

P(A) = 1 - P(A)

.375 = 1 - .625

.375 = .375

Page 20: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

Definition

• Given some variable that can be broken down into m categories designated by A1, A2, …, Ai, …, Am and another jointly occurring variable that is broken down into n categories designated by B1, B2, …, Bj, …, Bn, the marginal probability of Ai, P(Ai), is equal to the sum of the joint probabilities of Ai with all the categories of B. That is,

P(Ai) = Σ P (Ai∩Bj), for all values of j

Page 21: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

Example 3.4.9

• We wish to use the following equation and the data in Table 3.4.1 to compute the marginal probability P(M).

P(M) = P(M∩A)+ P(M∩B) +P(M∩C)

Page 22: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

P(M∩A) = 32/111 = .2883 P(M∩B) = 18/111 = .1622P(M∩C) = 25/111 = .2252P(M) = P(M∩A) + P(M∩B) + P(M∩C)

= .2883 + .1622 + .2252 = .6757

Page 23: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

Definitions

• A false positive results when a test indicates a positive status when the true status is negative.

• A false negative results when a test indicates a negative status when the true status is positive.

Page 24: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.
Page 25: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

Definition

•The sensitivity of a test (or symptom) is the probability of a positive test result (or presence of the symptom) given the presence of the disease.

P(T\D) = a/(a + c)

Page 26: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

Definition

•The specificity of a test (or symptom) is the probability of a negative test result (or absence of the symptom) given the absence of the disease.

P(T \ D) = d/(b + d)

Page 27: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

Definition •The predictive value positive of a

screening test (or symptom) is the probability that a subject has the disease given that the subject has a positive screening test result (or has the symptom).

P(D \ T) = P(T \ D) P(D)

P(T \ D) P(D) + P(T \ D) P(D)

Page 28: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

Definition • The predictive value negative

of a screening test (or symptom) is the probability that a subject does not have the disease, given that the subject has a negative screening test result (or does not have the symptom).

P(T│D) P(D) + P(T│D) P(D)P(D │T) = P(T│D) P(D)

Page 29: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.
Page 30: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

sensitivity = P(T \ D) = 436/450 = .9689specificity = P(T \ D) = 495/500 = .99P(T \ D) = 5/500 = .01P(D) = 450/950 = . 47P (D \ T )

= P(D) P (T\D)/ [P (D) P (T\D) + P(D) P(T\D)]= ( .47) ( .9689) /[( .47)( .9689) + (1-.47)(1

- .99)] = .98

D D total

T 436 5 441T 14 495 509

total 450 500 950

Page 31: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

期望值(expected value; expectation)

• 隨機變數之平均值稱之E(X) = μ = ΣXi Pr(Xi)

E(X - μ)2 = σ2 = Σ(Xi - μ)2 Pr(Xi)

= ΣXi2 Pr(Xi) - μ2 ΣPr(Xi)

= ΣXi2 Pr(Xi) - μ2

E(c) = c where c is constantE(cx) = cμE(c + x) = c +μE(Σx) = NμE(X2) = μ2 + σ2

E(ΣX)2 = N2μ2 + Nσ2

Page 32: 機率 SOME BASIC PROBABILITY CONCEPTS 台北醫學大學公共衛生學系 葉錦瑩.

Thanks for your attention

To be continued…..