Inverse Transform Method를 살펴보기 전에 다음 Theorem을 먼저 살펴보자.
Theorem.
어떤 함수 $F:\mathbb{R}→\mathbb{R}$가 다음 세 가지 조건을 만족하면, $F$는 어떤 random variable의 cumulative distribution function(cdf)이다.
(i) $F$는 nondecreasing하다.
(ii) $lim_{x\to \infty}F(x)=1, lim_{x\to -\infty}F(x)=0$
(iii) $F$는 right continuous하다. (즉, $lim_{y↓x}F(y)=F(x)$이다.)
위의 Theorem을 증명하기 위해 저 세 가지 조건을 만족시키는 함수 $F$를 cdf로 갖는 random variable이 존재함을 보이기만 하면 된다.
어떤 probability space $(\Omega, \mathcal{F}, P)$를 다음과 같이 정의하자.
$\Omega=(0,1), \mathcal{F}=$Borel Sets$, P:\mathcal{F}→[0,1], P=$Lebesgue measure.
어떤 함수 $F^{-1}:\Omega→\mathbb{R}$를 다음과 같이 정의하자.
$F^{-1}(w)=sup\{y|F(y)<w\}(=inf\{y|F(y)≥w\})$
* 위 노테이션은 저 함수를 정의한 기호이다. Inverse image가 아니다.
measurable한 function의 property들을 통해 function $F^{-1}$이 measurable함을 보일 수 있다. (Exercise)
따라서 $F^{-1}$은 random variable이다.
$F^{-1}$의 distribution 함수는 measurable space $(\mathbb{R}, \mathcal{B}(\mathbb{R}))$에서 $\mu=P\circ (F^{-1})^{-1}:\mathcal{B}(\mathbb{R})→\mathbb{R}$로 유도되고, $F^{-1}$의 cdf를 $G$라 하면, $G:\mathbb{R}→\mathbb{R}$은 다음과 같다.
* 이때의 $-1$은 inverse image이다.
$G(x)=\mu((-\infty,x])=P((F^{-1})^{-1}((-\infty,x])):=P(F^{-1}≤x)$
이제 $G=F$임을 보이면 증명이 끝난다.
$P$가 Lebesgue measure이기 때문에 다음을 보이는 것만으로도 충분하다.
$((F^{-1})^{-1}((-\infty,x])=)\{w\in\Omega|F^{-1}(w)≤x\}=\{w\in\Omega|w≤F(x)\}$ ★
$(\because P(\{w\in\Omega|w≤F(x)\})=P((0,F(x)))=F(x))$
$\Leftarrow w\in\{w|w≤F(x)\}$를 Fix한다. 그러면 $x\notin\{y|F(y)<w\}$이고 $F$가 nondecreasing하기 때문에 $F^{-1}(w)≤x$이다.
$\Rightarrow$ Contrapositive를 통해 증명된다. $w>F(x)$라 하면, $F$가 right continuous하기 때문에 $∃\delta>0\ s.t.\ F(x+\delta)<w$. 따라서, $F^{-1}(w)≥x+\delta>x$이다.
$\blacksquare$
컴퓨터에서 어떤 cumulative distribution function $F$를 가지는 random variable을 generate하고 싶을 때, Inverse Transform Method를 사용할 수 있다.
To Generate $X\sim F$,
1. Generate $U\sim Unif(0,1)$
2. Calculate $F^{-1}(U)$
어떤 probability Space $(\Omega^\prime, \mathcal{F}^\prime, P^\prime)$ 위에서 uniform distribution $\mu^\prime$를 가지는 random variable $U:\Omega^\prime→\mathbb{R}$를 다음과 같이 정의할 수 있다.
$\mu^\prime=P^\prime\circ U^{-1}, \mu^\prime (I)=b-a, ∀I⊂(0,1)$ (a,b는 $I$의 end point들)
$F^{-1}$의 정의 및 probability space를 위의 증명에서 쓰인 것과 똑같이 정의한다면 probability space $(\Omega^\prime, \mathcal{F}^\prime, P^\prime)$에서 probability space $(\Omega, \mathcal{F}, P)$로 가고, 다시 measurable space $(\mathbb{R}, \mathcal{B}(\mathbb{R}))$로 가는 새로운 well-defined되는 함수 $F^{-1}(U)$를 만들 수 있다.
Borel set $B\in\mathcal{B}(\mathbb{R})$하나를 Fix하자. $F^{-1}$이 random variable이므로 $(F^{-1})^{-1}(B)\in\mathcal{F}$이다. $\mathcal{F}=$Borel Sets이고 $U$가 random variable이므로 $U^{-1}((F^{-1})^{-1}(B))\in\mathcal{F}^\prime$이다. 따라서 $F^{-1}(U)$가 random variable이다.
이제 $F^{-1}(U)$의 cdf가 $F(x)$가 됨을 보이면 된다.
$F^{-1}(U)$의 cdf를 $H(x)$라 할때,
$H(x)$
$=P^\prime(\{w\in\Omega^\prime|F^{-1}(U(w))≤x\})$ ($\because$ def of cdf)
$=P^\prime(\{w\in\Omega^\prime|U(w) ≤F(x)\})$ ($\because$ ★)
$=P^\prime(U^{-1}((0,F(x)])=F(x)-0=F(x)$ ($\because$ def of $U$)
$\blacksquare$
따라서 컴퓨터에서 random variable $U$를 generate, 즉 $U$의 함숫값 하나$(u\in\Omega)$를 랜덤으로 생성하고(runif(0,1)), 함숫값 $F^{-1}(u)$를 구해줌으로서 cdf $F(x)$를 따르는 random variable에서 generate한 값 $(F^{-1}(u)\in\mathbb{R})$을 하나 얻게 되는 것이다.
주요 참고문헌
- Durrett. (2019). Probability: Theory and Examples (5th edition)
- Ross. (2022). Simulation (6th edition)
'수학 > 통계학' 카테고리의 다른 글
| 다변수 벡터함수의 전미분과 OLS Estimator (0) | 2024.08.07 |
|---|