2017년 6월 12일 월요일

Bayesian Data Analysis

Bayes’ Theorem

$$P(H|D)=\frac{P(D|H)P(H)}{P(D)}$$
  • H: Hypothesis
  • D: Data
  • P(H): Prior. =사전정보 or 선입견
  • P(D): Evidence ~ constant
  • P(D|H): Likelihood
  • P(H|D): Posterior
    • 데이터(관찰값)가 주어졌을 때의 이론(모델)에 대한 확률. 

$$P(H|D)\propto P(D|H)P(H)$$

  • 관찰값 $X = (x_1, x_2, x_3, \ldots, x_n)$가 알려지지 않은 PDF(확률 밀도 함수) $f$에 의해서 생성된 데이터라고 생각하자.
    • 즉, PDF $f(X|\theta)$는 a function of parameters ($\theta$) with fixed data ($X$)이면서 likelihood function $f(X|\theta)=\mathcal L(\theta;X)$으로 볼 수 있음.
        
  • MLE는 $f$의 파라메터 $\theta$를 estimate함에 있어서, likelihood $\mathcal L(\theta;X)$를 최대로 만드는 $\theta$를 찾는 방법임. 즉, $\theta$가 주어진 상태에서의 데이터들의 확률을 최대화함
$$\hat \theta = \arg\max_\theta \mathcal L (\theta;X) = \arg\max_\theta f(X|\theta)$$
    • 이때, i.i.d.(independent and identical distributed) observation을 고려하면, $f(X|\theta) = \prod_i f(x_i|\theta) = \prod_i\mathcal L (\theta;x_i)$가 되며, 일반적으로 단조증가함수인 log를 활용하여 덧셈꼴을 만들고 log likelihood를 통해 $\theta$를 estimate한다.
    • 단점: 주어진 observation에 따라, MLE 계산 결과가 민감하게 변할 수 있음. 
  • 쉽게 설명하고 있는 참고 글들

Maximum a Posteriori Estimation (MAP)

  • (Bayes' Theorem을 이용해서,) 주어진 데이터 $X$에 대해 최대 확률($f(\theta|X)$)을 내는 $\theta$를 estimate한다.
    • $f(\theta)$: Prior
    • $\arg\max_\theta f(\theta|X)$: Likelihood
    • $f(\theta|X)$: Posterior
$$\arg\max_\theta f(\theta|X)=\arg\max_\theta \frac{f(X|\theta) f(\theta)}{f(X)} = \arg\max_\theta \frac{\mathcal L (\theta;X) f(\theta)}{f(X)}=\arg\max_\theta \mathcal L (\theta;X) f(\theta)$$
    • 따라서, Prior $f(\theta)$가 고정 상수라면 MLE와 MAP는 같은 결과가 나오겠지만, 그렇지 않은 경우, 데이터에 대한 사전정보를 이용함으로써 보다 좋은 선택을 할 수'도' 있겠다는 개념임.(=잘못된 선입견을 가질 경우 나쁜 선택을 할 수도 있음)

댓글 없음:

댓글 쓰기