SlideShare a Scribd company logo
Frequentist VS Bayesian
Integration issue

ThinkBayes
Introduction of bayesian inference

김진섭
서울대학교 보건대학원

January 14, 2014

김진섭

ThinkBayes
Frequentist VS Bayesian
Integration issue

목차

1

Frequentist VS Bayesian
확률을 보는 관점
Bayes’ rule

2

Integration issue
Why?
Simulation

김진섭

ThinkBayes
Frequentist VS Bayesian
Integration issue

확률을 보는 관점
Bayes’ rule

객관적 VS 주관적 확률

주사위를 던져 1이 나올 확률
1

객관적: 확률은 정확한 숫자로 존재하고 그것을 추정한다.

2

주관적: 알수 없다, 믿음을 계속 업데이트할 수 밖에..

주사위를 던져 1이 나올 확률에 대한 접근법
1

객관적: 계속 던져봐서 추정해보니 확률은 1/6인 듯 하다.

2

주관적: 1/6일 것 같은데, 계속 던져보니 1/6이 맞는 것
같네..

김진섭

ThinkBayes
Frequentist VS Bayesian
Integration issue

확률을 보는 관점
Bayes’ rule

Homo bayesianis

Figure : Fun example of bayesian

김진섭

ThinkBayes
Frequentist VS Bayesian
Integration issue

확률을 보는 관점
Bayes’ rule

Frequentist의 논쟁법

상대방: 신약이랑 기존 약이랑 혈압강하효과가 차이가 없는 것
같은데..
나: 뭐? 신약이랑 기존 약이랑 차이가 0이라고?? 차이가 0
이라고 치자. 그러면 어쩌구저쩌구.. 이 데이터의 상황이 나올
가능성이 거의 없는데(5%미만인데)? 그니까 넌 틀렸어.
1

차이가 0이라고 말한 사람은 없다. 가상의적을 난타.

2

상대방의 주장을 최대한 좁게 해석하여 반박.

3

얍삽하다.

김진섭

ThinkBayes
Frequentist VS Bayesian
Integration issue

확률을 보는 관점
Bayes’ rule

Bayesian의 논쟁법

상대방: 신약이랑 기존 약이랑 혈압강하효과가 차이가 없는 것
같은데.. N(0, 1)분포를 따르지 않을까?
나: 차이가 N(0, 1)을 따른다고 가정하자. 가정에 따르면 이
데이터의 상황이 주어졌을 때, 차이의 조건부확률을
계산해보니 N(5, 1.2)를 따르는데?
1

사전믿음에 대한 분포를 가정: Prior

2

데이터가 주는 정보: Likelihood

3

믿음과 데이터의 정보를 종합 : Posterior- 이걸로 해석.

김진섭

ThinkBayes
Frequentist VS Bayesian
Integration issue

확률을 보는 관점
Bayes’ rule

Conditional probability

P(A ∩ B)
P(B)
P(A ∩ B)
P(B) × P(A|B)
P(B|A) =
=
P(A)
P(A)
P(B|A) ∝ P(B) × P(A|B)
P(A|B) =

김진섭

ThinkBayes

(1)
Frequentist VS Bayesian
Integration issue

확률을 보는 관점
Bayes’ rule

Bayesian inference

P(θ) × P(data|θ)
P(data)
P(θ|data) ∝ P(θ) × P(data|θ)

P(θ|data) =

Posterior ∝ Prior × Likelihood
P(data) 구해야 되는데...
P(data) = P(θ) × P(data|θ)dθ

김진섭

ThinkBayes

(2)
Frequentist VS Bayesian
Integration issue

확률을 보는 관점
Bayes’ rule

Prior, likelihood, posterior

Figure : Prior, likelihood, posterior
김진섭

ThinkBayes
Frequentist VS Bayesian
Integration issue

Why?
Simulation

1

Posterior 분포를 그려야 평균 or 95% C.I....

2

Prior와 Likelihood가 적당히 좋은 함수라면 Posterior가 잘
알고 있는 분포가 될 수도..

3

대부분은 Posterior는 알고 있는 분포가 아니다...
적분불가능.

김진섭

ThinkBayes
Frequentist VS Bayesian
Integration issue

Why?
Simulation

Monte Carlo integration

1

적분을 시뮬레이션으로 해결하겠다.

2

예) N(0,1) 적분 : N(0,1)에서 sample N개 뽑아서 그것의
평균, N이 커지면 원래 적분값에 가까워짐.

즉, f (x) 적분할 때 f (x)에서 샘플링 많이 해서 그것의
평균으로..
f (x) 샘플링 어려울 땐 비슷하게 생긴 g (x)이용 : Importance
sampling

김진섭

ThinkBayes
Frequentist VS Bayesian
Integration issue

Why?
Simulation

Monte carlo example

Figure : 원의 넓이 구하기

김진섭

ThinkBayes
Frequentist VS Bayesian
Integration issue

Why?
Simulation

Monte carlo example(2)

Figure : Integration of f (x)

김진섭

ThinkBayes
Frequentist VS Bayesian
Integration issue

Why?
Simulation

MCMC(Markov chain Monte Carlo)

1

Monte carlo: Random sampling- 효율이 떨어짐.

2

다변량 분석, 특히 multilevel 샘플링 어렵다.

MCMC
1

Markov chain MC : 바로 전의 샘플링한것을 이용하여
sampling - 효율, hierarchial model에 적합.

2

Metropolis-Hastings 알고리즘, Gibbs sampler(거의 표준)

김진섭

ThinkBayes
Frequentist VS Bayesian
Integration issue

Why?
Simulation

Gibbs sampler

Figure : Example of gibbs sampling: 2 variables

김진섭

ThinkBayes
Frequentist VS Bayesian
Integration issue

Why?
Simulation

Multivariable gibbs sampler

Figure : Gibbs sampling: > 2 variables

김진섭

ThinkBayes

More Related Content

What's hot

Case-crossover study
Case-crossover studyCase-crossover study
Case-crossover study
Jinseob Kim
 
Rciu
RciuRciu
What is bayesian statistics and how is it different?
What is bayesian statistics and how is it different?What is bayesian statistics and how is it different?
What is bayesian statistics and how is it different?
Wayne Lee
 
cours d'obstétrique : Hémorragies du premier trimestre de la grossesse
cours d'obstétrique : Hémorragies du premier trimestre de la grossessecours d'obstétrique : Hémorragies du premier trimestre de la grossesse
cours d'obstétrique : Hémorragies du premier trimestre de la grossesse
Ilham El Azizi
 
Hta et grossesse 2019
Hta et grossesse 2019Hta et grossesse 2019
Hta et grossesse 2019
Nacer CHRAIBI
 
PROM AND PPROM BY Dr Alihussein kassam
PROM AND PPROM BY Dr Alihussein kassamPROM AND PPROM BY Dr Alihussein kassam
PROM AND PPROM BY Dr Alihussein kassam
Dr Alihussein Kassam
 
Observation en gynecologie examen clinique salle de travail
Observation en gynecologie   examen clinique salle de travailObservation en gynecologie   examen clinique salle de travail
Observation en gynecologie examen clinique salle de travail
Idi Amadou
 
3. Nephrotic Syndrome
3. Nephrotic Syndrome3. Nephrotic Syndrome
3. Nephrotic Syndrome
Whiteraven68
 
Retard de croissance intra utérin 2014
Retard de croissance intra utérin 2014Retard de croissance intra utérin 2014
Retard de croissance intra utérin 2014
FMM Marrakech
 
Ovaire polykystique
Ovaire polykystiqueOvaire polykystique
Ovaire polykystique
ARICHI Bouchra
 
Algorithm febrile seizures
Algorithm febrile seizuresAlgorithm febrile seizures
Algorithm febrile seizures
Ahmed AbuZade
 
Obestetrics history taking and examination
Obestetrics history taking and examinationObestetrics history taking and examination
Obestetrics history taking and examination
Faculty of Medicine - Benha University
 
Molar pregnancy
Molar pregnancyMolar pregnancy
Molar pregnancy
Aadarsh Bhadel
 
Infections urinaires final
Infections urinaires finalInfections urinaires final
Infections urinaires final
Martin Darras
 
Traitement des infections urinaires de l'adulte SMMI 2018
Traitement des infections urinaires de l'adulte SMMI 2018Traitement des infections urinaires de l'adulte SMMI 2018
Traitement des infections urinaires de l'adulte SMMI 2018
SMMI2015
 
Saturation du sang veineux en oxygene
Saturation du sang veineux en oxygene Saturation du sang veineux en oxygene
Saturation du sang veineux en oxygene
Patou Conrath
 
HTA ET GROSSESSE . 2014
HTA ET GROSSESSE .  2014HTA ET GROSSESSE .  2014
HTA ET GROSSESSE . 2014
Alain Cmi
 
Case Study - Pediatric - Septic Shock
Case Study - Pediatric - Septic ShockCase Study - Pediatric - Septic Shock
Case Study - Pediatric - Septic Shock
Uscom - Case Studies
 
Angiocholite aiguë
Angiocholite aiguë Angiocholite aiguë
Angiocholite aiguë
CHU Tlemcen
 
Panhypopituitarisme
PanhypopituitarismePanhypopituitarisme
Panhypopituitarisme
Fahd Ida
 

What's hot (20)

Case-crossover study
Case-crossover studyCase-crossover study
Case-crossover study
 
Rciu
RciuRciu
Rciu
 
What is bayesian statistics and how is it different?
What is bayesian statistics and how is it different?What is bayesian statistics and how is it different?
What is bayesian statistics and how is it different?
 
cours d'obstétrique : Hémorragies du premier trimestre de la grossesse
cours d'obstétrique : Hémorragies du premier trimestre de la grossessecours d'obstétrique : Hémorragies du premier trimestre de la grossesse
cours d'obstétrique : Hémorragies du premier trimestre de la grossesse
 
Hta et grossesse 2019
Hta et grossesse 2019Hta et grossesse 2019
Hta et grossesse 2019
 
PROM AND PPROM BY Dr Alihussein kassam
PROM AND PPROM BY Dr Alihussein kassamPROM AND PPROM BY Dr Alihussein kassam
PROM AND PPROM BY Dr Alihussein kassam
 
Observation en gynecologie examen clinique salle de travail
Observation en gynecologie   examen clinique salle de travailObservation en gynecologie   examen clinique salle de travail
Observation en gynecologie examen clinique salle de travail
 
3. Nephrotic Syndrome
3. Nephrotic Syndrome3. Nephrotic Syndrome
3. Nephrotic Syndrome
 
Retard de croissance intra utérin 2014
Retard de croissance intra utérin 2014Retard de croissance intra utérin 2014
Retard de croissance intra utérin 2014
 
Ovaire polykystique
Ovaire polykystiqueOvaire polykystique
Ovaire polykystique
 
Algorithm febrile seizures
Algorithm febrile seizuresAlgorithm febrile seizures
Algorithm febrile seizures
 
Obestetrics history taking and examination
Obestetrics history taking and examinationObestetrics history taking and examination
Obestetrics history taking and examination
 
Molar pregnancy
Molar pregnancyMolar pregnancy
Molar pregnancy
 
Infections urinaires final
Infections urinaires finalInfections urinaires final
Infections urinaires final
 
Traitement des infections urinaires de l'adulte SMMI 2018
Traitement des infections urinaires de l'adulte SMMI 2018Traitement des infections urinaires de l'adulte SMMI 2018
Traitement des infections urinaires de l'adulte SMMI 2018
 
Saturation du sang veineux en oxygene
Saturation du sang veineux en oxygene Saturation du sang veineux en oxygene
Saturation du sang veineux en oxygene
 
HTA ET GROSSESSE . 2014
HTA ET GROSSESSE .  2014HTA ET GROSSESSE .  2014
HTA ET GROSSESSE . 2014
 
Case Study - Pediatric - Septic Shock
Case Study - Pediatric - Septic ShockCase Study - Pediatric - Septic Shock
Case Study - Pediatric - Septic Shock
 
Angiocholite aiguë
Angiocholite aiguë Angiocholite aiguë
Angiocholite aiguë
 
Panhypopituitarisme
PanhypopituitarismePanhypopituitarisme
Panhypopituitarisme
 

More from Jinseob Kim

Unsupervised Deep Learning Applied to Breast Density Segmentation and Mammogr...
Unsupervised Deep Learning Applied to Breast Density Segmentation and Mammogr...Unsupervised Deep Learning Applied to Breast Density Segmentation and Mammogr...
Unsupervised Deep Learning Applied to Breast Density Segmentation and Mammogr...
Jinseob Kim
 
Fst, selection index
Fst, selection indexFst, selection index
Fst, selection index
Jinseob Kim
 
Why Does Deep and Cheap Learning Work So Well
Why Does Deep and Cheap Learning Work So WellWhy Does Deep and Cheap Learning Work So Well
Why Does Deep and Cheap Learning Work So Well
Jinseob Kim
 
괴델(Godel)의 불완전성 정리 증명의 이해.
괴델(Godel)의 불완전성 정리 증명의 이해.괴델(Godel)의 불완전성 정리 증명의 이해.
괴델(Godel)의 불완전성 정리 증명의 이해.
Jinseob Kim
 
New Epidemiologic Measures in Multilevel Study: Median Risk Ratio, Median Haz...
New Epidemiologic Measures in Multilevel Study: Median Risk Ratio, Median Haz...New Epidemiologic Measures in Multilevel Study: Median Risk Ratio, Median Haz...
New Epidemiologic Measures in Multilevel Study: Median Risk Ratio, Median Haz...
Jinseob Kim
 
가설검정의 심리학
가설검정의 심리학 가설검정의 심리학
가설검정의 심리학
Jinseob Kim
 
Win Above Replacement in Sabermetrics
Win Above Replacement in SabermetricsWin Above Replacement in Sabermetrics
Win Above Replacement in Sabermetrics
Jinseob Kim
 
Regression Basic : MLE
Regression  Basic : MLERegression  Basic : MLE
Regression Basic : MLE
Jinseob Kim
 
iHS calculation in R
iHS calculation in RiHS calculation in R
iHS calculation in R
Jinseob Kim
 
Fst in R
Fst in R Fst in R
Fst in R
Jinseob Kim
 
Selection index population_genetics
Selection index population_geneticsSelection index population_genetics
Selection index population_genetics
Jinseob Kim
 
질병부담계산: Dismod mr gbd2010
질병부담계산: Dismod mr gbd2010질병부담계산: Dismod mr gbd2010
질병부담계산: Dismod mr gbd2010
Jinseob Kim
 
DALY & QALY
DALY & QALYDALY & QALY
DALY & QALY
Jinseob Kim
 
Deep Learning by JSKIM (Korean)
Deep Learning by JSKIM (Korean)Deep Learning by JSKIM (Korean)
Deep Learning by JSKIM (Korean)
Jinseob Kim
 
Machine Learning Introduction
Machine Learning IntroductionMachine Learning Introduction
Machine Learning Introduction
Jinseob Kim
 
Tree advanced
Tree advancedTree advanced
Tree advanced
Jinseob Kim
 
Deep learning by JSKIM
Deep learning by JSKIMDeep learning by JSKIM
Deep learning by JSKIM
Jinseob Kim
 
Main result
Main result Main result
Main result
Jinseob Kim
 
Multilevel study
Multilevel study Multilevel study
Multilevel study
Jinseob Kim
 
GEE & GLMM in GWAS
GEE & GLMM in GWASGEE & GLMM in GWAS
GEE & GLMM in GWAS
Jinseob Kim
 

More from Jinseob Kim (20)

Unsupervised Deep Learning Applied to Breast Density Segmentation and Mammogr...
Unsupervised Deep Learning Applied to Breast Density Segmentation and Mammogr...Unsupervised Deep Learning Applied to Breast Density Segmentation and Mammogr...
Unsupervised Deep Learning Applied to Breast Density Segmentation and Mammogr...
 
Fst, selection index
Fst, selection indexFst, selection index
Fst, selection index
 
Why Does Deep and Cheap Learning Work So Well
Why Does Deep and Cheap Learning Work So WellWhy Does Deep and Cheap Learning Work So Well
Why Does Deep and Cheap Learning Work So Well
 
괴델(Godel)의 불완전성 정리 증명의 이해.
괴델(Godel)의 불완전성 정리 증명의 이해.괴델(Godel)의 불완전성 정리 증명의 이해.
괴델(Godel)의 불완전성 정리 증명의 이해.
 
New Epidemiologic Measures in Multilevel Study: Median Risk Ratio, Median Haz...
New Epidemiologic Measures in Multilevel Study: Median Risk Ratio, Median Haz...New Epidemiologic Measures in Multilevel Study: Median Risk Ratio, Median Haz...
New Epidemiologic Measures in Multilevel Study: Median Risk Ratio, Median Haz...
 
가설검정의 심리학
가설검정의 심리학 가설검정의 심리학
가설검정의 심리학
 
Win Above Replacement in Sabermetrics
Win Above Replacement in SabermetricsWin Above Replacement in Sabermetrics
Win Above Replacement in Sabermetrics
 
Regression Basic : MLE
Regression  Basic : MLERegression  Basic : MLE
Regression Basic : MLE
 
iHS calculation in R
iHS calculation in RiHS calculation in R
iHS calculation in R
 
Fst in R
Fst in R Fst in R
Fst in R
 
Selection index population_genetics
Selection index population_geneticsSelection index population_genetics
Selection index population_genetics
 
질병부담계산: Dismod mr gbd2010
질병부담계산: Dismod mr gbd2010질병부담계산: Dismod mr gbd2010
질병부담계산: Dismod mr gbd2010
 
DALY & QALY
DALY & QALYDALY & QALY
DALY & QALY
 
Deep Learning by JSKIM (Korean)
Deep Learning by JSKIM (Korean)Deep Learning by JSKIM (Korean)
Deep Learning by JSKIM (Korean)
 
Machine Learning Introduction
Machine Learning IntroductionMachine Learning Introduction
Machine Learning Introduction
 
Tree advanced
Tree advancedTree advanced
Tree advanced
 
Deep learning by JSKIM
Deep learning by JSKIMDeep learning by JSKIM
Deep learning by JSKIM
 
Main result
Main result Main result
Main result
 
Multilevel study
Multilevel study Multilevel study
Multilevel study
 
GEE & GLMM in GWAS
GEE & GLMM in GWASGEE & GLMM in GWAS
GEE & GLMM in GWAS
 

Think bayes

  • 1. Frequentist VS Bayesian Integration issue ThinkBayes Introduction of bayesian inference 김진섭 서울대학교 보건대학원 January 14, 2014 김진섭 ThinkBayes
  • 2. Frequentist VS Bayesian Integration issue 목차 1 Frequentist VS Bayesian 확률을 보는 관점 Bayes’ rule 2 Integration issue Why? Simulation 김진섭 ThinkBayes
  • 3. Frequentist VS Bayesian Integration issue 확률을 보는 관점 Bayes’ rule 객관적 VS 주관적 확률 주사위를 던져 1이 나올 확률 1 객관적: 확률은 정확한 숫자로 존재하고 그것을 추정한다. 2 주관적: 알수 없다, 믿음을 계속 업데이트할 수 밖에.. 주사위를 던져 1이 나올 확률에 대한 접근법 1 객관적: 계속 던져봐서 추정해보니 확률은 1/6인 듯 하다. 2 주관적: 1/6일 것 같은데, 계속 던져보니 1/6이 맞는 것 같네.. 김진섭 ThinkBayes
  • 4. Frequentist VS Bayesian Integration issue 확률을 보는 관점 Bayes’ rule Homo bayesianis Figure : Fun example of bayesian 김진섭 ThinkBayes
  • 5. Frequentist VS Bayesian Integration issue 확률을 보는 관점 Bayes’ rule Frequentist의 논쟁법 상대방: 신약이랑 기존 약이랑 혈압강하효과가 차이가 없는 것 같은데.. 나: 뭐? 신약이랑 기존 약이랑 차이가 0이라고?? 차이가 0 이라고 치자. 그러면 어쩌구저쩌구.. 이 데이터의 상황이 나올 가능성이 거의 없는데(5%미만인데)? 그니까 넌 틀렸어. 1 차이가 0이라고 말한 사람은 없다. 가상의적을 난타. 2 상대방의 주장을 최대한 좁게 해석하여 반박. 3 얍삽하다. 김진섭 ThinkBayes
  • 6. Frequentist VS Bayesian Integration issue 확률을 보는 관점 Bayes’ rule Bayesian의 논쟁법 상대방: 신약이랑 기존 약이랑 혈압강하효과가 차이가 없는 것 같은데.. N(0, 1)분포를 따르지 않을까? 나: 차이가 N(0, 1)을 따른다고 가정하자. 가정에 따르면 이 데이터의 상황이 주어졌을 때, 차이의 조건부확률을 계산해보니 N(5, 1.2)를 따르는데? 1 사전믿음에 대한 분포를 가정: Prior 2 데이터가 주는 정보: Likelihood 3 믿음과 데이터의 정보를 종합 : Posterior- 이걸로 해석. 김진섭 ThinkBayes
  • 7. Frequentist VS Bayesian Integration issue 확률을 보는 관점 Bayes’ rule Conditional probability P(A ∩ B) P(B) P(A ∩ B) P(B) × P(A|B) P(B|A) = = P(A) P(A) P(B|A) ∝ P(B) × P(A|B) P(A|B) = 김진섭 ThinkBayes (1)
  • 8. Frequentist VS Bayesian Integration issue 확률을 보는 관점 Bayes’ rule Bayesian inference P(θ) × P(data|θ) P(data) P(θ|data) ∝ P(θ) × P(data|θ) P(θ|data) = Posterior ∝ Prior × Likelihood P(data) 구해야 되는데... P(data) = P(θ) × P(data|θ)dθ 김진섭 ThinkBayes (2)
  • 9. Frequentist VS Bayesian Integration issue 확률을 보는 관점 Bayes’ rule Prior, likelihood, posterior Figure : Prior, likelihood, posterior 김진섭 ThinkBayes
  • 10. Frequentist VS Bayesian Integration issue Why? Simulation 1 Posterior 분포를 그려야 평균 or 95% C.I.... 2 Prior와 Likelihood가 적당히 좋은 함수라면 Posterior가 잘 알고 있는 분포가 될 수도.. 3 대부분은 Posterior는 알고 있는 분포가 아니다... 적분불가능. 김진섭 ThinkBayes
  • 11. Frequentist VS Bayesian Integration issue Why? Simulation Monte Carlo integration 1 적분을 시뮬레이션으로 해결하겠다. 2 예) N(0,1) 적분 : N(0,1)에서 sample N개 뽑아서 그것의 평균, N이 커지면 원래 적분값에 가까워짐. 즉, f (x) 적분할 때 f (x)에서 샘플링 많이 해서 그것의 평균으로.. f (x) 샘플링 어려울 땐 비슷하게 생긴 g (x)이용 : Importance sampling 김진섭 ThinkBayes
  • 12. Frequentist VS Bayesian Integration issue Why? Simulation Monte carlo example Figure : 원의 넓이 구하기 김진섭 ThinkBayes
  • 13. Frequentist VS Bayesian Integration issue Why? Simulation Monte carlo example(2) Figure : Integration of f (x) 김진섭 ThinkBayes
  • 14. Frequentist VS Bayesian Integration issue Why? Simulation MCMC(Markov chain Monte Carlo) 1 Monte carlo: Random sampling- 효율이 떨어짐. 2 다변량 분석, 특히 multilevel 샘플링 어렵다. MCMC 1 Markov chain MC : 바로 전의 샘플링한것을 이용하여 sampling - 효율, hierarchial model에 적합. 2 Metropolis-Hastings 알고리즘, Gibbs sampler(거의 표준) 김진섭 ThinkBayes
  • 15. Frequentist VS Bayesian Integration issue Why? Simulation Gibbs sampler Figure : Example of gibbs sampling: 2 variables 김진섭 ThinkBayes
  • 16. Frequentist VS Bayesian Integration issue Why? Simulation Multivariable gibbs sampler Figure : Gibbs sampling: > 2 variables 김진섭 ThinkBayes