'''random variable''' Alternate pagename: [[확률변수,random_variable]] [[랜덤변수,random_variable]] Sub: [[이산확률변수,discrete_RV]] [[이항확률변수,binomial_RV]] [[연속확률변수,continuous_RV]] [[균등확률변수,uniform_RV]] [[가우스확률변수Gaussian(Normal)_RV]] { https://blastic.tistory.com/185 } ---- [[TableOfContents]] = 먼저 = 초보자에게 헷갈리는 것 * 확률변수는 사실 변수가 아니고 함수다. 함수이지만 변수처럼 다룬다고 해서 이름이 확률변수인가? * 확률변수는 보통 알파벳 X를 쓴다. 이름이 변수인데다 문자도 X로 쓰고 소문자 x도 같이 나오니 혼란스럽다. * 대문자 X, Y, Z 등은 확률변수(즉 함수)고, 그것이 가질 수 있는 값?(치역의 원소? 정의역의 원소? 무엇?) CHK 을 소문자 x, y, z등으로 쓰는 것 같다. = Definition of RV = A RV $X$ is a real-valued function of the experimental outcome. $X:\mathbb{\Omega}\to\mathbb{R}$ 여기서 $\mathbb{\Omega}$ = [[VG:표본공간,sample_space]] = Discrete RV (DRV) = A RV $X$ is discrete if its range is finite or countably infinite. 여기서, range $r(X)=\left{x\middle|\exists\omega\in\mathbb{\Omega}\textrm{ such that }X(\omega)=x\right}$ 즉 sample $\omega$ 를 $x$ 라는 값으로 대응시키는? 그런 함수가 $X$ 이고 그것을 독립변수(or 정의역)로 하는 대응관계가 range r? 조건제시법 이해가 잘... ex. two fair coin tosses X = # of heads Ω = {HH, HT, TH, TT} X(HH) = 2 X(TT) = 0 r(X) = {0, 1, 2} ex. sampling a number ω from [-1,1] $X(\omega)=\begin{cases}1,&\textrm{ if }\omega>0\\0,&\textrm{ if }\omega=0\\-1,&\textrm{ if }\omega<0\end{cases}$ 페이지: [[이산확률변수,discrete_RV]] = Probability mass function (PMF) = The PMF $p_X(x)$ of a DRV $X$ is defined as: $p_X(x)=P(X=x)=P\left(\left{\omega\in\mathbb{\Omega}\middle|X(\omega)=x\right}\right)$ 위의 동전던지기를 예로 들면 $p_X(x)=$ ¼ if x=0 TT ½ if x=1 HT TH ¼ if x=2 HH = Mean or expectation = 평균 or 기대값 $E[X]=\sum_x x\cdot P_X(x)$ 위 동전던지기를 예로 들면 앞면이 나오는 횟수의 기대값은 E[X]= 0·¼ + 1·½ + 2·¼ = 1 = Variance = 분산 $V[X]=E[(X-E[X])^2]=\sum_x(x-E[X])^2P_X(x)$ Properties 특징 i) $E[aX+b]=aE[X]+b$ ii) ${\rm Var}[aX+b]=a^2{\rm Var}(X)$ = Conditioning RV on event = Given an event $A$ with $P(A)>0,$ the conditional PMF $P_{X|A}$ of a DRV $X$ is defined as $P_{X|A}(x)=P(X=x|A)=\frac{P(\left{X=x\right}\cap A)}{P(A)}$ Conditioning X on Y: $P_{X|Y}(x|y)=P(X=x|Y=y)$ $=\frac{P(X=x,Y=y)}{P(Y=y)}$ $=\frac{P_{X,Y}(x,y)}{P_Y(y)}$ $=P(\{X=x\}\cap\{Y=y\})$ $=P(\{\omega\in\mathbb{\Omega}|X(\omega)=x\textrm{ and }Y(\omega)=y\})$ = Conditional expectation = $E[X|A]=\sum_x x\cdot P_{X|A}(x)$ = Joint PMF of two DRVs = X, Y: DRVs $P_{X,Y}(x,y)=P(X=x,Y=y)$ = Independence = Two DRVs $X$ and $Y$ are independent if $P_{X,Y}(x,y)=P_X(x)P_Y(y)\;\;\;\forall x,y$ = Continuous RV (CRV) = A RV $X$ is continuous if there exists a non-negative function $f_X()$ such that $P(X\in B)=\int_B f_X(x)dx,\;\;\forall B\subset\mathbb{R}$ interval B가 $B=[a,b]$ 라면 $P(a\le X\le b)=\int_a^b f_X(x)dx$ 페이지: [[연속확률변수,continuous_RV]] = DRV and CRV = || || DRV || CRV || ||PF || PMF [[br]] $P_X(x)=P(X=x)$ || PDF [[br]] $f_X(x),P(X\in B)=\int_B f_X(x)dx$ || ||DF || CDF [[br]] $F_X(k)=P(X\le k)=\sum_{x\le k} P_X(x)$ || CDF [[br]] $F_X(x)=P(X\le x)=\int_{-\infty}^x f_X(t)dt$ || ||Mean || $E[X]=\sum_x xP_X(x)$ || $E[X]=\int_{-\infty}^{\infty} xf_X(x)dx$ || ||Var || $V(X)=\sum(x-E[X])^2P_X(x)$ || $V(X)=\int_{-\infty}^{\infty}(x-E[X])^2dx$ || = 독립 and Joint = discrete에 independence가 있다면 continuous에 joint가 있다? raised comma=⸴ ||Independence ||P,,X⸴Y,,(x,y)=P,,X,,(x)·P,,Y,,(y) ||f,,X⸴Y,,(x,y)=f,,X,,(x)·f,,Y,,(y), ∀x,y || ||Conditioning ||P,,X|Y,,(x|y)=P,,X⸴Y,,(x,y) / P,,Y,,(y) ||f,,X|Y,,(x|y)=f,,X⸴Y,,(x,y) / f,,Y,,(y) || 이제부터 $P$ 와 $\mathbb{P}$ 를 구분하겠음 = Total expectation theorem = A,,1,,, … A,,n,,: partition of Ω $\mathbb{P}(A_i)>0$ $E[X]=\sum_{i=1}^n \mathbb{P}(A_i)E[X|A_i]$ $=\sum_{i} \mathbb{P}(A_i) \sum_x x P_{X|A_i}(x)$ $=\sum_{i} \mathbb{P}(A_i) \sum_x x\cdot \mathbb{P}(X=x|A_i)$ $=\sum_x x \sum_i \mathbb{P}(A_i) \mathbb{P}(X=x|A_i)$ 전확률정리에 의해 $=\sum_x x \mathbb{P}(X=x)$ = Markov inequality = 대충 RV가 얼마 이상일 확률의 상한을 제시하는 그런 것인듯 그 상한은 평균에 비례. Let $X$ be a nonnegative RV. Then $\forall a>0,$ $\mathbb{P}(X\ge a)\le \frac{E[X]}a$ Proof) $1_{\{x\ge a\}}=\begin{cases}1,&\text{ if }x\ge a\\0,&\text{ if }x\lt a\end{cases}$ 여기서 1은 indicator function 이하 첨자의 중괄호를 ()로 쓰겠음 (입력하기 힘들어서) $a\cdot1_{(x\ge a)} \le X$ $\Rightarrow E[a\cdot1_{(x\ge a)}]\le E[X]$ 좌변 $=a\cdot\mathbb{P}(x\ge a)+0\cdot \mathbb{P}(x\lt a)$ $=a\cdot \mathbb{P}(x\ge a)$ Ex. uniform random variable X $X\sim{\rm Unif}[0,10]$ $f_X(x)=\begin{cases}1/10,&\text{ if }0\le x\le 10\\0,&\text{otherwise}\end{cases}$ $E(X)=5$ $a=5$ 를 가정 $\mathbb{P}(X\ge 5)\le \frac55 = 1$ $\mathbb{P}(X\ge 6)\le\frac56$ (from 이향원 건대강의) ---- Def. Let RV $X(\ge 0)$ with $E(X)$ and 상수 $a(>0)$ then, $P(X\ge a)\le\frac{E(X)}{a}$ 왜냐하면, 연속확률변수(c.r.v.) X에 대해, $E(X)=\int_0^{\infty}xf_X(x)dx$ $=\int_0^a xf_X(x)dx+\int_a^{\infty}xf_X(x)dx$ $\ge\int_a^{\infty}xf_X(x)dx$ 그런데 $a\le x<\infty$ 이므로, $\ge\int_a^{\infty}af_X(x)dx$ $=a\int_a^{\infty}f_X(x)dx$ $=aP(X\ge a)$ 따라서 $P(X\ge a)\le\frac{E(X)}{a}$ from 경북대 최영숙 확률과정 13. The Markov and Chebyshev Inequalities Multiple Random Variables http://www.kocw.net/home/search/kemView.do?kemId=1279832 = Chebyshev inequality = 체비셰프 부등식 For a RV $X$ with mean $\mu$ and variance $\sigma^2,\forall a>0,$ $\mathbb{P}(|X-\mu|\ge a)\le\frac{\sigma^2}{a^2}$ 좌변을 다르게 표현하면 $\mathbb{P}(X-\mu>a\textrm{ or }X-\mu\le-a)$ 아울러 다음도 당연히 성립 $\mathbb{P}(X-\mu\ge a)\le \mathbb{P}(X-\mu>a\textrm{ or }X-\mu\le-a)$ see also [[VG:부등식,inequality]] Proof) $\mathbb{P}(|X-\mu|\ge a)=\mathbb{P}((X-\mu)^2\ge a^2)$ Markov ineq.를 적용하면 $=\frac{E[(X-\mu)^2]}{a^2}$ from 건국대 ---- Def. Let $E(X)=m$ and $Var(X)=\sigma^2$ of R.V. $X.$ then, $P(|X-m|\ge a)\le\frac{\sigma^2}{a^2}\;(a>0)$ 이유: Let $D^2=(X-m)^2.$ By M.I.(Markov ineq.), $P(D^2\ge a^2)\le\frac{E(D^2)}{a^2}=\frac{\sigma^2}{a^2}$ 위 좌변의 괄호 안의 $D^2\ge a^2$ 은, $\Leftrightarrow D\ge a,D\le -a$ $\Leftrightarrow |D|\ge a$ $\Leftrightarrow |X-m|\ge a$ Note 1. $P(|X-m|0).$ $P(|X-m|\ge k\sigma)\le\frac{\sigma^2}{(k\sigma)^2}=\frac1{k^2}.$ 좌변 괄호 안을 생각하면 For Gaussian random variable $X,$ $\left|\frac{X-m}{\sigma}\right|\ge k$ $Z:$ standard Gaussian random variable. ex. If continuous RV X with E(X)=15 and σ=3, find the upper bound for P(|X-m|>5). sol. By Chebyshev ineq, $P(|X-m|>5)\le\frac9{25}=0.36$ from 경북대 최영숙 확률과정 13. The Markov and Chebyshev Inequalities Multiple Random Variables http://www.kocw.net/home/search/kemView.do?kemId=1279832 = Chernoff bound = Let $X_1,\cdots,X_n$ be [[i.i.d.]] Bernoulli RVs with parameter $p.$ Let $S_n=\sum_{i=1}^n X_i,$ $\mu=E[S_n]=np.$ Then, $\mathbb{P}(S_n\ge(1+\varepsilon)\mu)\le\left(\frac{e^{-\varepsilon}}{1+\varepsilon}\right)^{1+\varepsilon},\;\;\;\;\forall\varepsilon>0$ $\mathbb{P}$ 안의 내용 $S_n\ge(1+\varepsilon)\mu$ 을 다시 쓰면 $S_n-\mu\ge\varepsilon\mu$ 즉, 평균에서 $\varepsilon\mu$ 만큼 벗어날 확률이 오른쪽 식만큼 bound가 된다. 또 다른 theorem: $\mathbb{P}(S_n\le(1-\varepsilon)\mu)\le\left(\frac{e^{-\varepsilon}}{1-\varepsilon}\right)^{1-\varepsilon},\quad\quad 0<\varepsilon<1.$ 증명에 앞서 (independent하면) $E[XY]=E[X]E[Y]$ 일반적으로 $E\left[\prod_i X_i\right]=\prod_i E[X_i]$ 곱하기의 평균 = 평균의 곱하기 Proof) $\mathbb{P}(S_n\ge(1+\epsilon)\mu)$ $=\mathbb{P}(tS_n\ge(1+\epsilon)\mu t)$ $=\mathbb{P}(e^{tS_n}\ge e^{(1+\epsilon)\mu t})$ Markov ineq.를 적용하면, $\le\frac{E[e^{tS_n}]}{e^{(1+\epsilon)\mu t}}$ 우변을 풀어서 써보면 $=e^{-(1+\epsilon)\mu t}E\left[\prod_{i=1}^n e^{tX_i}\right]$ 위의 independent 성질을 이용하면 $=e^{-(1+\epsilon)\mu t}\prod_{i=1}^n E[e^{tX_i}]$ (∵ independence of X,,i,,'s) $=e^{-(1+\epsilon)\mu t}\prod_{i=1}^n\left( p\cdot e^t + (1-p) \right)$ $=e^{-(1+\epsilon)\mu t}\prod_{i=1}^n\left( 1+(e^t-1)p \right)$ 부등식 $1+x\le e^x$ 를 이용하면 $\le e^{-(1+\epsilon)\mu t}\prod_{i=1}^n e^{(e^t-1)p}$ $=e^{-(1+\epsilon)\mu t}e^{(e^t-1)\mu}$ $=e^{-(1+\epsilon)\mu t+e^t\mu-\mu$ 이 값을 최소화하려면, upper bound가 작으면 작을수록 좋으니까, t에 대해 미분해서 값이 0이 될 때를 생각하면 minimized at $t=\log(1+\epsilon)$ $=e^{(-(1+\epsilon)\log(1+\epsilon)+1+\epsilon-1)\mu}$ $=e^{(\log(1+\epsilon)^{-(1+\epsilon)}+\epsilon)\mu}$ $=e^{\mu\log((1+\epsilon)^{-(1+\epsilon)}e^{\epsilon})$ $=\left(\frac{e^{\epsilon}}{(1+\epsilon)^{1+\epsilon}}\right)^{\mu}$ $\mathbb{P}(S_n\ge(1+\epsilon)\mu)\le\left(\frac{e^{ \epsilon}}{(1+\epsilon)^{1+\epsilon}}\right)^{\mu}\le e^{-\frac{\epsilon^2\mu}{3}}$ $\mathbb{P}(S_n\ge(1-\epsilon)\mu)\le\left(\frac{e^{-\epsilon}}{(1-\epsilon)^{1-\epsilon}}\right)^{\mu}\le e^{-\frac{\epsilon^2\mu}{2}}$ $(1-\epsilon)^{1-\epsilon}>\exp(-\epsilon+\frac12\epsilon^2)$ $(1-\epsilon)\log(1-\epsilon)>-\epsilon+\frac12\epsilon^2$ (from 이향원 건대강의) ---- (from 이향원 [[http://kocw.net/home/search/kemView.do?kemId=991018 건대강의]]) ---- MV TO [[VG:확률변수,random_variable]] Up: [[확률및랜덤프로세스,probability_and_random_process]] RENAMETHISPAGE