Memorandum of Bayes' Theorem
Cat: SCI
Pub: 2020
#2013
Compiled by Kanzo Kobayashi
20726u
Title
Memorandum of Bayes' Theorem
ベイズの定理メモ
Index
Tag
; ; conditional probabilty; ; ; ; ; insufficient reason; ; ; ; ; ; ;
Why
- Reference:
- Bayesian Statistics The Fun Way by Will Kurt (2020/7) by SB Creative
- Bayes' Rule with R by James V. Stone (2016) by Sebtel Press
- Wikipedia, etc.
Original resume
Remarks
>Top 0. Preface:
- Bayes' theorem describes the probability of an event: discovered Thomas Bayes (1701c-1761) and developed by Pierre-Simon Laplace (1749-1827)
- This theorem was rediscovered after 200 years, which is a wonderful theorem: the posterior probability as a consequence of two antecedents can be derived from prior probability and a likelihood function.
- Frequency theory: data is variable, parameter is constant, while Bayes' theorem data is constant, parameter is variable.
- Bayes' theorem treats probability p of each events which are not independent: conditional probability.
- Bayes' theorem is effective tool to estimate parameter of a statistical model, or a state-space model; degree of belief is quantified by probability, and when observed data is added, the prior information become posterior information.
0. 序文:
- Prior
>Top 1. Bayes' theorem
- Bayesian inference:
- a method of statistical inference used Bayes' theorem.; which is widely applied in science, engineering, philosophy, medicine, sports, and law.
- Theorem:
P(H|D)=P(H)P(D|H)P(D)
- H stands for any hypothesis whose probability is affected by E (=evidence, or data).
- P(H) is prior probability; estimate of the probability of the hypothesis H before the data E.
(事前確率: データを見る以前に、自己の仮説の信用率)
- D is data, or evidence; corresponds to new data that were not used in computing P(H)
- P(H|D) is the posterior probability; the probability of H given, or after E is observed.; This is what we want to know; the probability of a hypothesis given or after the observed evidence E.
(事後確率: データを踏まえた上で自己の仮説をどれだけ信じられるか)
- P(D|H) is the probability of observing D given H, and is called the likelihood. As a function of D with H fixed, it indicated the compatibility of the evidence with the given hypothesis.
(尤度: 自己の仮説が正しいとした場合に、既存のデータが得られる確率)
- P(D) is termed marginal likelihood or model evidence; this factor is the same for all possible hypotheses being considered.
(仮説に関係なく、このデータが観察される確率。事後確率が0と1の間に収まるようにする。このデータを決めるのは難しい。)
→P(H|D)∝P(H)P(D|H) [事後確率比→事後オッズ]
- P(D\H1)P(D\H2)
(ベイズ因子: 自説を支持する可能性と、他説を支持する可能性との比較)
→ 自説が指示されるかどうか気にせずに、自説が観測データとどれだけよく支持するかにのみ着目する。→自説を裏付けを得るか、または自説の裏付けが弱くなり自説を変えざるを得なくなるか。)
- P(H|D)=P(D|H)P(H)P(D|H)P(H)+P(D|¬H)P(¬H)
where, P(H)+P(¬H)=1, and
P(D)=P(D|H)P(H)+P(D|¬H)P(¬H)
- Rule of multiplication: P(D∩H)=P(D|H)P(H)=P(H|D)P(D)
1. ベイズ理論:
- given that: もしthat以下ならば
- likelihood: 尤度
- maximum likelihood estimate: 最尤推定
- sample space: 標本空間
- probability space: 確率空間
- elementary event: 根元事象
- Bayesian inference: ベイズ推定
- prior probability: 事前確率
=conditional potability: 条件付き確率
probability of A given B: P(A|B),PB(A)
- likelihood function: 尤度関数
- marginal likelihood: 周辺尤度
- posterior probability: 事後確率
- uniform distribution: 一様分布
- ベイズ理論:
- Flip causation: 因果関係を逆転
- Prior P: P(θ)
- Posterior P: P(θ|X)
- P(θ|X)=P(θ)・P(X|θ)P(X)
- EAP (Expected a posteriori):
=∫f(θ|X)θdθ
=∫f(X|θ)f(θ)f(X)θdθ
- Bayes Theorem:
Probability of Hypothesis given the Evidence equals Likelihood of Evidence ☓ Prior Probability in all positives (True or False)

>Top 2. Monty Hall problem:
- By US TV game show 'Let's Make a Deal' after its original host, Monty Hall.
- Suppose you're on a game show, and you're given the choice of three doors. Behind the one door is a present; behind others nothing.
- You pick a door, say #1, and the host, who knows what's behind the doors, opens another door which has nothing.
- He then says to you, "Do you want to pick the door #2?" Is it to your advantage to switch your choice?
- Under the standard assumptions, contestants who switch have a 23 chance of winning a present, while contestants who stick to their initial choice have only a 13 chance.
- ¶Let the event of three doors as A,B,C having a possible present behind, and the event by opening a door by the host as a,b,c: then, the probability of regarding the door A when the host opened the door c.
- Pc(A)=P(A)PA(c)P(c)=1312P(c)
Pc(B)=P(B)PB(c)P(c)=13・1P(c)
→2Pc(A)=Pc(B),Pc(A)+Pc(B)=1
∴Pc(A)=13,Pc(B)=23
- → The advantage is to switch your choice.
- ¶Here are three vases A,B,C containing 2 blue balls & 1 red ball, 1 blue ball & 2 red balls, and 3 red balls respectively.
- Pick up 1 ball from each vase, which was a red ball. Find probability such that the red ball was taken from the vase containing 3 red balls.
- H1:pickedup1ballfromthevaseAcontaining1redball
- H2:pickedup1ballfromthevaseAcontaining2redballa
- H3:pickedup1ballfromthevaseAcontaining3redballa
- D:1ballpickedupwasred
- P0(H3)=P(H3)PH3(D)P(H1)PH1(D)+P(H2)PH2(D)+P(H3)PH3(D)...(*)
- >Top Probability is considered as same unless any information: [Principle of insufficient reason]
here: P(H1)=P(H2)=P(H3)=13
- (*): $$P_0(H_3)=\frac{\frac{1}{3}・\frac{3}{3}}
{\frac{1}{3}・\frac{1}{3}+\frac{1}{3}・\frac{2}{3}+\frac{1}{3}・\frac{3}{3}}
=\frac{1}{2}$
- This problem is applicable to other cases, such that; spam mail filter uses vases as mail or documents, and balls as words.
2. モンティ・ホール問題:

- 壺とボールの問題:


>Top 3. Infection by illness problem:
- Infection by illness:
- Probability of who are sick: P(B1)=0.0001
- Probability of who are not sick: P(B2)=0.9999
- Probability of showing positive who are sick: P(A|B1)=0.95 [true positive]
- Probability of showing positive who are not sick: P(A|B2)=0.20 [false positive]
- Then, probability of being sick who are positive: P(B1|A)
=P(B1)P(A|B1)P(B1)P(A|B1)+P(B2)P(A|B2)
=0.0001・0.950.0001・0.95+0.9999・0.20=0.000475
3. 病気感染問題:

- ¶Medical diagnosis:
- Medical care indicates that different illnesses may produce identical symptom. Suppos a particular set os symptoms, denoted as even H, occurs infected any one of three illness - A,B,C. (for simplicity, A,B,C are mutually exclusive). Studies show these probabilities of getting the three illnesses:
- P(A)=.01;P(B)=.005;P(C)=.02
- The probabilities of developping the symptoms H, given a spcific illness, are:
- P(H|A)=.90;P(H|B)=.95;P(H|C)=.75
- Assuming that an ill person shows the sysmptoms H, what is the probability that the person has illness A?
- P(A|H)=P(A)P(H|A)P(A)P(H|A)+P(B)P(H|B)+P(C)P(H|C)
=.01×.90.01×.90+.005×.96+.02×.75=.3130
- Say:
- A: Covid-19
- B: Pneumonia
- C: Influenza
- H: fever
>Top 4. Defective product ratio problem:
- Defective product ratio:
A certain product is made in three factories A,B,C, have its share 50%, 30%, 20% respectively; and its ratio of defective product is 1%, 3%, 5% respectively.
- ¶When some defective product is claimed, find the probability which factory-C made it.
- Product share of A: P(B_a)=0.5
- Product share of B: P(B_b)=0.3
- Product share of C: P(B_c)=0.2
- Defective product ratio of A: P(A|B_a)=0.01
- Defective product ratio of B: P(A|B_b)=0.03
- Defective product ratio of C: P(A|B_c)=0.05
- Then the ratio of defective product made in factory-C: P(B_c|A)
=P(Bc)P(A|Bc)P(Ba)P(A|Ba)+P(Bb)P(A|Bb)+P(Bc)P(A|Bc)
=0.2・0.050.5・0.01+0.3・0.03+0.2・0.05=0.4177
4. 製品欠陥率問題:

>Top 5. Secretary problem:
- Also known as marriage problem, or best choice problem.
- Formulation:
- There is a single position to fill.
- There are n applicants for the position, and the value of n is known.
- The applicants are interviewed sequentially in random order.
- After an interview, the interviewed applicant is either accepted or rejected immediately, which is irrevocable.
- The decision can be based only on the relative ranks of the applicants interviewed so far.
- The objective is to have the highest probability of selecting the best applicant of the whole group.
- Proof:
- Let the No.1 exists in k-th in total n applicants.
- The interviewer rejects unconditionally the first t applicants in total n applicants.
- The condition of selecting No.1 is: there is tentatively best applicant within the range of until t-th applicant until (k−1)-th applicants .
The probability is selecting t within k−1:
that is tk−1
- if t≥k the probability is 0, and if t<k is tk−1.
- the probability of No.1 exists k-th is 1n
- thus: Probability of selecting the best applicant:
P(t)=1nn∑k=t+1tk−1=tn(1t+1t+1+⋯+1n−1)...(*)
The answer is the maximum t of (*)
- here: (1t+1t+1+⋯+1n−1)≃lnnt
- thus: 1nn∑k=t+1tk−1=tnlnnt
- (tnlnnt)′=1nlnnt−1n...(**)
- find max t:lnnt=1→nt=e→∴t=ne
- Cf: when n=100, then t=1003=36.765≃=37
P(t)=tnlnnt=37100lne=0.37
5. 秘書問題:
- from Maclaurin's extension:
ex=∞∑k=0xkk!−1+x+x22+x36+⋯
→ex≥1+x
- then:
exp(1+12+13+⋯+1n
=exp(1)exp(12)⋯exp(1n)
≥(1+1)(1+12)⋯(1+1n)
=23243⋯n+1n=n+1
→n∑k=1≥ln(n+1)
- Euler constant: γ
=limn→∞(n∑k=11k−lnn)
- Secretary problem:

>Top 6. Spam mail:
- {Spam mail=A1Not-Spam mail=A2
- generally 70% is smal mail: P(A1)=0.7
- when mail B contains the word of for free: P(B|A1)=0.09,P(B|A2)=0.01
- then: P(A1|B)=P(B|A1)P(A1)P(B|A1)P(A1)+P(B|A2)P(A2)
=0.09×0.70.09×0.7+0.01×(1−0.7)≈0.9545
- when the mail contains sure victory:
P(C|A1)=0.11,P(C|A2)=0.02
then: 0.11×0.95450.11×0.9545+0.02×(1−0.9545)≈0.9914
- further, when the mail contains definite answer:
P(D|A1)=0.14,P(C|A2)=0.03
then: 0.14×0.99140.14×0.9914+0.03×(1−0.9914)≈0.9981
- furthermore, when the mail contains bonus:
P(D|A1)=0.07,P(C|A2)=0.01
then: 0.07×0.99810.07×0.9981+0.01×(1−0.9981)≈0.9997
6. 迷惑メール:
>Top 7. xxxx:
7. xxxx:
>Top 8. xxxx:
8. xxxx:
>Top 9. xxxx:
9. xxxx:
>Top 10. xxxx:
10. xxxx:
>Top 11. xxxx:
11. xxxx:
>Top 12. xxxx:
12. xxxx:
>Top 13. xxxx:
13. xxxx:
>Top 14. xxxx:
14. xxxx:
>Top 15. xxxx:
15. xxxx:
>Top 16. xxxx:
16. xxxx:
>Top 17. xxxx:
17. xxxx:
>Top 18. xxxx:
18. xxxx:
>Top 19. xxxx:
19. xxxx:
>Top 20. xxxx:
20. xxxx:
>Top 21. xxxx:
21. xxxx:
>Top 22. xxxx:
22. xxxx:
>Top 23. xxxx:
23. xxxx:
>Top 24. xxxx:
24. xxxx:
>Top 25. xxxx:
25. xxxx:
Comment
- a
- a
Memorandum of Bayes' Theorem |
Cat: SCI |
|
Compiled by Kanzo Kobayashi |
20726u |
Title |
Memorandum of Bayes' Theorem |
ベイズの定理メモ |
Index |
||
Tag |
; ; conditional probabilty; ; ; ; ; insufficient reason; ; ; ; ; ; ; | |
Why |
|
Original resume |
Remarks |
>Top 0. Preface:
|
0. 序文:
|
>Top 1. Bayes' theorem
|
1. ベイズ理論:
|
>Top 2. Monty Hall problem:
|
2. モンティ・ホール問題:
|
>Top 3. Infection by illness problem:
|
3. 病気感染問題: |
|
|
|
>Top 4. Defective product ratio problem:
|
4. 製品欠陥率問題: |
>Top 5. Secretary problem:
|
5. 秘書問題:
|
>Top 6. Spam mail:
|
6. 迷惑メール: |
>Top 7. xxxx: |
7. xxxx: |
>Top 8. xxxx: |
8. xxxx: |
>Top 9. xxxx: |
9. xxxx: |
>Top 10. xxxx: |
10. xxxx: |
>Top 11. xxxx: |
11. xxxx: |
>Top 12. xxxx: |
12. xxxx: |
>Top 13. xxxx: |
13. xxxx: |
>Top 14. xxxx: |
14. xxxx: |
>Top 15. xxxx: |
15. xxxx: |
>Top 16. xxxx: |
16. xxxx: |
>Top 17. xxxx: |
17. xxxx: |
>Top 18. xxxx: |
18. xxxx: |
>Top 19. xxxx: |
19. xxxx: |
>Top 20. xxxx: |
20. xxxx: |
>Top 21. xxxx: |
21. xxxx: |
>Top 22. xxxx: |
22. xxxx: |
>Top 23. xxxx: |
23. xxxx: |
>Top 24. xxxx: |
24. xxxx: |
>Top 25. xxxx: |
25. xxxx: |
Comment |
|
|