DeepLearning

Prior Probability, Posterior Probability

jiheek 2021. 10. 14. 15:58

Bayesian Statistics in ML

어떤 집단에서 D 병에 걸린 사람의 비율이 0.01퍼센트라고 하자.

이 때 임의로 고른 사람이 병에 걸렸을 확률은, P(prior)=0.01이다.

 

이제 병 검사의 specificity(probability that the test will come out negative for a person without the disease.)는 95%이고, sensitivity(probability that the test is positive for a person with the disease)는 99%이다.

이 때 임의로 고른 사람이 병에 걸렸을 확률은 무엇일까?

 

즉, 어떤 사람의 테스트 결과가 positive일 때 D 병에 걸렸을 conditional probability는 무엇일까?

  Test results  
확진 유무 Positive Negative Total
infected A: 0.01*(0.99)
=0.0099
0.01*(1-0.99) 0.01
not infected 0.99*(1-0.95) B: 0.99*(0.95) 0.99
total 0.0594 0.9406 1

A: 실제로 걸렸는데, 테스트에서도 걸렸다고(positive) 나온 비율

B: 실제로 안걸렸는데, 테스트에서도 안걸렸다고(negative) 나온 비율

 

테스트 결과 D 병에 걸렸다고 나온 비율은 0.0594이고, 그 중 실제로 병에 걸린 사람은 0.0099/0.0594 = 16.7%이다.

  • 테스트가 positive일 때 실제로 걸렸을 확률: P(posterior)=0.167

조건부 확률 개념과 동일하다!

 

따라서, 객체가 D 병에 실제로 걸렸을 posterior(테스트 결과가 나온 후) probability는 0.167이다.

이 예시에서는 probability가 prior:0.01에서 posterior:0.167로 바뀌었다.

 


간단한 설명

 

θ에 관심이 있다고 할 때,

  • prior probability: 데이터를 모으거나 측정하기 전의 θ에 대한 uncertainty를 나타낸다.

distribution 표현: π(θ)

  • posterior probability: 데이터를 모으거나 측정한 후의 θ에 대한 uncertainty를 나타낸다.

distribution 표현: π(θ|X)

관찰된 데이터에 대한 조건부 확률이다.


source: https://www.statistics.com/glossary/prior-and-posterior-probability-difference/