Download Document

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Statistics wikipedia , lookup

History of statistics wikipedia , lookup

Birthday problem wikipedia , lookup

Ars Conjectandi wikipedia , lookup

Probability interpretations wikipedia , lookup

Probability wikipedia , lookup

Transcript
機率
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 的交集合。
機率的基本觀念
• 實驗(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).
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
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.
•What is the probability that this person
will be a male?
P(M) = number of males / total number of subjects
= 75 / 111 = .6757
機率的基本觀念
• 機率的獲得
– 理論機率(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)
機率運算法則
• 加法法則(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)
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
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
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
條件機率
(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".
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
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
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)
• 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?
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
Example 3.4.7
• 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?
eyeglass
girl
boy
total
yes
24
16
40
no
36
24
60
total
60
40
100
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
• What is the probability of the joint
occurrence of the events of wearing
eyeglasses and being a boy?
eyeglass
yes
no
total
girl
24
36
60
boy
16
24
40
total
40
60
100
P(E∩B)=P(B)P(E\B)
P(E∩B)=P(B)P(E)=(40/100)(40/100)= .16
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
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
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)
P(M∩A)=32/111= .2883
P(M∩B)=18/111= .1622
P(M∩C)=25/111= .2252
P(M)=P(M∩A)+P(M∩B)+P(M∩C)
= .2883+ .1622+ .2252 = .6757
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.
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)
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)
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)
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(D │T)=
P(T│D) P(D)
P(T│D) P(D) + P(T│D) P(D)
T
T
total
D
D
436
14
450
5
495
500
total
441
509
950
sensitivity=P(T \ D)=436/450= .9689
specificity=P(T \ D)=495/500= .99
P(T \ D)=5/500= .01
P(D)=450/950= . 47
P (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
期望值
(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 constant
E(cx) = cμ
E(c+x)= c +μ
E(Σx) = Nμ
E(X2) = μ2 + σ2
E(ΣX)2 = N2μ2 + Nσ2
To be continued…..
Thanks for your attention