SlideShare a Scribd company logo
1 of 16
Download to read offline
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

Tokyowebmining19 data fusion
Tokyowebmining19 data fusionTokyowebmining19 data fusion
Tokyowebmining19 data fusion
Yohei Sato
 
大規模グラフアルゴリズムの最先端
大規模グラフアルゴリズムの最先端大規模グラフアルゴリズムの最先端
大規模グラフアルゴリズムの最先端
Takuya Akiba
 

What's hot (20)

Leveraged Gaussian Process
Leveraged Gaussian ProcessLeveraged Gaussian Process
Leveraged Gaussian Process
 
Kaggle Santa 2019で学ぶMIP最適化入門
Kaggle Santa 2019で学ぶMIP最適化入門Kaggle Santa 2019で学ぶMIP最適化入門
Kaggle Santa 2019で学ぶMIP最適化入門
 
AI alignment from the Active Inference perspective 2023.pdf
AI alignment from the Active Inference perspective 2023.pdfAI alignment from the Active Inference perspective 2023.pdf
AI alignment from the Active Inference perspective 2023.pdf
 
Deep Encoder, Shallow Decoder: Reevaluating Non-autoregressive Machine Transl...
Deep Encoder, Shallow Decoder: Reevaluating Non-autoregressive Machine Transl...Deep Encoder, Shallow Decoder: Reevaluating Non-autoregressive Machine Transl...
Deep Encoder, Shallow Decoder: Reevaluating Non-autoregressive Machine Transl...
 
Goodfellow先生おすすめのGAN論文6つを紹介
Goodfellow先生おすすめのGAN論文6つを紹介Goodfellow先生おすすめのGAN論文6つを紹介
Goodfellow先生おすすめのGAN論文6つを紹介
 
球面と双曲面の幾何学入門の入門
球面と双曲面の幾何学入門の入門球面と双曲面の幾何学入門の入門
球面と双曲面の幾何学入門の入門
 
Taking a Deeper Look at the Inverse Compositional Algorithm
Taking a Deeper Look at the Inverse Compositional AlgorithmTaking a Deeper Look at the Inverse Compositional Algorithm
Taking a Deeper Look at the Inverse Compositional Algorithm
 
An introduction to bayesian statistics
An introduction to bayesian statisticsAn introduction to bayesian statistics
An introduction to bayesian statistics
 
【DL輪読会】HRDA: Context-Aware High-Resolution Domain-Adaptive Semantic Segmentat...
【DL輪読会】HRDA: Context-Aware High-Resolution Domain-Adaptive Semantic Segmentat...【DL輪読会】HRDA: Context-Aware High-Resolution Domain-Adaptive Semantic Segmentat...
【DL輪読会】HRDA: Context-Aware High-Resolution Domain-Adaptive Semantic Segmentat...
 
能動学習セミナー
能動学習セミナー能動学習セミナー
能動学習セミナー
 
Physics-Informed Machine Learning Methods for Data Analytics and Model Diagno...
Physics-Informed Machine Learning Methods for Data Analytics and Model Diagno...Physics-Informed Machine Learning Methods for Data Analytics and Model Diagno...
Physics-Informed Machine Learning Methods for Data Analytics and Model Diagno...
 
Toward Disentanglement through Understand ELBO
Toward Disentanglement through Understand ELBOToward Disentanglement through Understand ELBO
Toward Disentanglement through Understand ELBO
 
言語モデル入門 (第二版)
言語モデル入門 (第二版)言語モデル入門 (第二版)
言語モデル入門 (第二版)
 
Tokyowebmining19 data fusion
Tokyowebmining19 data fusionTokyowebmining19 data fusion
Tokyowebmining19 data fusion
 
PRML 10.4 - 10.6
PRML 10.4 - 10.6PRML 10.4 - 10.6
PRML 10.4 - 10.6
 
Graph Edit Distance: Basics & Trends
Graph Edit Distance: Basics & TrendsGraph Edit Distance: Basics & Trends
Graph Edit Distance: Basics & Trends
 
大規模グラフアルゴリズムの最先端
大規模グラフアルゴリズムの最先端大規模グラフアルゴリズムの最先端
大規模グラフアルゴリズムの最先端
 
Visualizing Data Using t-SNE
Visualizing Data Using t-SNEVisualizing Data Using t-SNE
Visualizing Data Using t-SNE
 
自由エネルギー原理と視覚的意識 2019-06-08
自由エネルギー原理と視覚的意識 2019-06-08自由エネルギー原理と視覚的意識 2019-06-08
自由エネルギー原理と視覚的意識 2019-06-08
 
情報検索とゼロショット学習
情報検索とゼロショット学習情報検索とゼロショット学習
情報検索とゼロショット学習
 

More from 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
 

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
 
Case-crossover study
Case-crossover studyCase-crossover study
Case-crossover study
 
Generalized Additive Model
Generalized Additive Model Generalized Additive Model
Generalized Additive Model
 
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
 

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