Mean, Variance, and Covariance
โํ๋ฅ ๊ณผ ํต๊ณ(MATH230)โ ์์ ์์ ๋ฐฐ์ด ๊ฒ๊ณผ ๊ณต๋ถํ ๊ฒ์ ์ ๋ฆฌํ ํฌ์คํธ์ ๋๋ค. ์ ์ฒด ํฌ์คํธ๋ Probability and Statistics์์ ํ์ธํ์ค ์ ์์ต๋๋ค ๐ฒ
Mean
Definition.
The <expectation> or <mean> of a RV $X$ is defined as
\[\mu := E[x] := \begin{cases} \displaystyle \sum_x x f(x) && X \; \text{is a discrete with pmf} f(x) \; \\ \displaystyle \int^{\infty}_{\infty} x f(x) dx && X \; \text{is a continuous with pdf} \; f(x) \end{cases}\]๋ง์ฝ RV $X$์ ํจ์ $g(x)$๋ฅผ ์ทจํ๋ค๋ฉด, <Expectation>์ ์๋์ ๊ฐ์ด ๊ตฌํ ์ ์๋ค.
Theorem.
Let $X$ be a random variable with probability distribution $f(x)$. The expected value of the random variable $g(X)$ is
\[\mu_{g(X)} = E\left[g(X)\right] = \sum_x g(x) f(x) \quad \text{if } X \text{ is discrete RV}\]and
\[\mu_{g(X)} = E\left[g(X)\right] = \int^{\infty}_{\infty} g(x) f(x) \quad \text{if } X \text{ is continuous RV}\]($g(x)$๋ฅผ ์ทจํ๋ ์ฌ์ ํ $x$์ ์ ์์ญ์ ์ ์ง๋๋ฏ๋ก, ์์ ๊ฐ์ด $g(x) f(x)$๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ ํ๋นํ๋ค.)
ps) ์์ ์๊ฐ์ ๊ต์๋๊ป์ ์ด์ฐ RV์ ๋ํ ์ฆ๋ช ์ ์ฝ๊ฒ ํ ์ ์์ง๋ง, ์ฐ์ RV์ ๋ํ ์ฆ๋ช ์ ์ข ๊น๋ค๋กญ๋ค๊ณ ํ์ จ๋ค.
์ด๋ฒ์๋ joint distributions์ ๋ํ <Expectation>์ ์ดํด๋ณด์.
Definition.
Let $X$ and $Y$ be RVs with joint probability distribution $f(x, y)$. The expected value of the RV $g(X, Y)$ is
\[\mu_{g(X, Y)} = E\left[g(X, Y)\right] = \sum_x \sum_y g(x, y) f(x, y) \quad \text{if } X \text{ and } Y \text{ is discrete RV}\] \[\mu_{g(X, Y)} = E\left[g(X, Y)\right] = \int^{\infty}_{-\infty} \int^{\infty}_{-\infty} g(x, y) f(x, y) \; dx dy \quad \text{if } X \text{ and } Y \text{ is continuous RV}\]Conditional Distribution์ ๋ํด์๋ <Expectation>์ ์๊ฐํด๋ณผ ์ ์๋ค.
Definition.
Linearity of Expectation
<Expectation>์ <Linearity>๋ผ๋ ์์ฃผ ์ข์ ์ฑ์ง์ ๊ฐ์ง๋ค.
Theorem.
Let $a, b \in \mathbb{R}$, then $E\left[aX + b\right] = aE[X] + b$.
์์ ์ ๋ฆฌ๊ฐ ๋งํด์ฃผ๋ ๊ฒ์ <Expectation>์ด Linear Operator์์ ๋งํด์ค๋ค!! ๐คฉ
์ข๋ ํ์ฅํด์ ๊ธฐ์ ํด๋ณด๋ฉด,
Theorem.
Theorem.
Expectation with Independence
๋ง์ฝ ๋ RV $X$, $Y$๊ฐ ์๋ก <๋ ๋ฆฝ>์ด๋ผ๋ฉด, ๋ RV์ ๊ณฑ์ ๋ํ <Expectation>์ ์ฝ๊ฒ ๊ตฌํ ์ ์๋ค.
Theorem.
If $X$ and $Y$ are independent, then
\[E[XY] = E[X]E[Y]\]Variance and Covariance
๋ RV $X$, $Y$๊ฐ ๋์ผํ ํ๊ท ์ ๊ฐ์ง๋๋ผ๋; $E[X] = \mu = E[Y]$ RV์ ๊ฐ๋ณ ๊ฐ๋ค์ด ํ๊ท $\mu$๋ก๋ถํฐ ๋จ์ด์ ธ ์๋ ์ ๋๋ ๋ค๋ฅผ ์ ์๋ค. <๋ถ์ฐ Variance>๋ ์ด๋ฐ ํ๊ท ์ผ๋ก๋ถํฐ์ ํผ์ง ์ ๋๋ฅผ ์ธก์ ํ๋ ์งํ๋ก ์๋์ ๊ฐ์ด ์ ์ํ๋ค.
Definition.
The <variance> of a RV $X$ is defined as
\[\text{Var}(X) = E[(X-\mu)^2]\]and $\sigma = \sqrt{\text{Var}(X)}$ is called the <standard deviation> of $X$.
์๋์ ๊ณต์์ ์ฌ์ฉํ๋ฉด, $\text{Var}(X)$๋ฅผ ์ข๋ ์ฝ๊ฒ ๊ตฌํ ์ ์๋ค.
Theorem.
โ๋ถ์ฐ = ์ ํ - ํ์ โ, ๊ณ ๋ฑํ๊ต ๋ ๋ฐฐ์ด ๊ณต์์ด๋ค!
<Expectation>์ Linearity๋ผ๋ ์ข์ ์ฑ์ง์ ๊ฐ์ง๊ณ ์์๋ค. <๋ถ์ฐ Variance>์์๋ ์ด๋ป๊ฒ ๋๋์ง ์ดํด๋ณด์.
Theorem.
For any $a, b \in \mathbb{R}$,
\[\text{Var}(aX + b) = a^2 \text{Var}(X)\]Covariance
<๊ณต๋ถ์ฐ Covariance>๋ ๋ RV ์ฌ์ด์ ์ด๋ค <๊ด๊ณ relation>์ด ์๋์ง๋ฅผ ์กฐ์ฌํ๋ ์งํ๋ค. <๊ณต๋ถ์ฐ>์ ์๋์ ๊ฐ์ด ์ ์๋๋ค.
Definition.
The <covariane> of $X$ and $Y$ is defined as
\[\begin{aligned} \sigma_{XY} := \text{Cov}(X, Y) &= E \left[ (X - \mu_X) (Y - \mu_Y) \right] \\ &= E(XY) - E(X)E(Y) \end{aligned}\]- $\text{Cov}(X, X) = \text{Var}(X)$
- $\text{Cov}(aX + b, Y) = a \cdot \text{Cov}(X, Y)$
- $\text{Cov}(X, c) = 0$
์์์ ์ดํด๋ดค์ ๋, ๋ RV $X$, $Y$๊ฐ ๋ ๋ฆฝ์ด๋ผ๋ฉด, $E(XY) = E(X)E(Y)$๊ฐ ๋์๋ค. ๋ฐ๋ผ์ ๋ RV๊ฐ ๋ ๋ฆฝ์ผ ๋๋ $\text{Cov}(X, Y) = 0$์ด ๋๋ค! ๊ทธ๋ฌ๋ ์ฃผ์ํ ์ ์ ๋ช ์ ์ ์ญ(ๆ)์ธ $\text{Cov}(X, Y) = 0$์ผ ๋, ๋ RV๊ฐ ํญ์ ๋ ๋ฆฝ์์ ๋ณด์ฅํ์ง๋ ์๋๋ค!
<Covariance>์ ๋ RV์ Linear Combination์ ๋ํ ๋ถ์ฐ์ ๊ตฌํ ๋๋ ์ฌ์ฉํ๋ค.
Let $a, b, c \in \mathbb{R}$, then
\[\text{Var}(aX + bY + c) = a^2 \text{Var}(X) + b^2 \text{Var}(Y) + 2 \text{Cov}(X, Y)\]์ฆ๋ช ์ $\text{Var}(aX + bY + c)$์ ์๋ฏธ๋ฅผ ๊ทธ๋๋ก ์ ๊ฐํ๋ฉด ์ฝ๊ฒ ์ ๋ํ ์ ์๋ค.
\[\text{Var}(aX + bY + c) = E\left[ \left( (X+Y) - (\mu_X + \mu_Y) \right)^2 \right]\]Correlation
<๊ณต๋ถ์ฐ>์ ์ข๋ ๋ณด๊ธฐ ์ฝ๊ฒ Normalize ํ ๊ฒ์ด <Correlation>์ด๋ค.
Definition.
The <correlation> of $X$ and $Y$ is defined as
\[\rho_{XY} := \text{Corr}(X, Y) = \frac{\text{Cov}(X, Y)}{\sqrt{\text{Var}(X)} \sqrt{\text{Var}(Y)}}\]- if $\rho_{XY} > 0$, $X$ and $Y$ are positively correlated.
- if $\rho_{XY} < 0$, $X$ and $Y$ are negatively correlated.
- if $\rho_{XY} = 0$, $X$ and $Y$ are uncorrelated.
๋ง์ฝ ๋ RV๊ฐ ์๋ฒฝํ ์ ํ์ฑ์ ๋ณด์ธ๋ค๋ฉด, $\rho_{XY}$๊ฐ ์๋์ ๊ฐ๋ค.
- if $Y = aX + b$ for $a > 0$, then $\text{Corr}(X, Y) = 1$
- if $Y = aX + b$ for $a < 0$, then $\text{Corr}(X, Y) = -1$
์์ ๋ช ์ ๋ ๊ทธ ์ญ๋ ์ฑ๋ฆฝํ๋ค. ์ฆ๋ช ์ ์๋์ Exercise์์ ์งํํ๊ฒ ๋ค.
<Correlation>์ $[-1, 1]$์ ๊ฐ์ ๊ฐ๋๋ค. ์ด๋ <์ฝ์-์๋ฐ๋ฅดํธ ๋ถ๋ฑ์>์ ํตํด ์ ๋ํ ์ ์๋ค!
Cauchy-Schwarrtz inequality :
\[\left( \sum a_i b_i \right)^2 \le \sum a_i^2 \sum b_i^2\]Correlation ์์ ์๋ฏธ์ ๋งก๊ฒ ํ์ด์ฐ๋ฉด ์๋์ ๊ฐ๋ค.
\[\begin{aligned} \text{Corr}(X, Y) &= \frac{\text{Cov}(X, Y)}{\sqrt{\text{Var}(X)} \sqrt{\text{Var}(Y)}} = \frac{E[(X-\mu_X)(Y - \mu_Y)]}{\sqrt{E[(X-\mu_X)^2]} \sqrt{E[(Y-\mu_Y)^2]}} \\ &= \frac{\sum (X-\mu_X)(Y - \mu_Y)}{\sqrt{\sum (X-\mu_X)^2} \sqrt{\sum (Y-\mu_Y)^2}} \end{aligned}\]์ด์ ์์ ์์ ์ ๊ณฑํด์ ์ดํด๋ณด๋ฉด
\[(\rho_{XY})^2 = \left( \frac{\sum (X-\mu_X)(Y - \mu_Y)}{\sqrt{\sum (X-\mu_X)^2} \sqrt{\sum (Y-\mu_Y)^2}} \right)^2 = \frac{\left( \sum (X-\mu_X)(Y - \mu_Y) \right)^2 }{\sum (X-\mu_X)^2 \sum (Y-\mu_Y)^2}\]<์ฝ์-์๋ฐ๋ฅด์ธ ๋ถ๋ฑ์>์์ ์ฐ๋ณ์ ์ข๋ณ์ผ๋ก ์ด๋ํ๋ฉด, ์๋์ ๊ฐ์ ๋ถ๋ฑ์์ด ์ฑ๋ฆฝํ๋ค.
\[\frac{\left( \sum a_i b_i \right)^2}{\sum a_i^2 \sum b_i^2} \le 1\]์ด๋ฅผ <Correlation>์ ์ ๊ณฑ์์ ์ ์ฉํ๋ฉด ์๋์ ๊ฐ๋ค.
\[(\rho_{XY})^2 = \frac{\left( \sum (X-\mu_X)(Y - \mu_Y) \right)^2 }{\sum (X-\mu_X)^2 \sum (Y-\mu_Y)^2} \le 1\]๋ฐ๋ผ์ $(\rho_{XY})^2 \le 1$์ด๋ฏ๋ก
\[-1 \le \rho_{XY} \le 1\]$\blacksquare$
์ถ๊ฐ๋ก <Correlation>์ โํ์คํโํ RV์ ๊ณต๋ถ์ฐ์ผ๋ก๋ ํด์ํ ์ ์๋ค.
$Z = \dfrac{X-\mu_X}{\sigma_X}$, $W = \dfrac{Y-\mu_Y}{\sigma_Y}$๋ผ๊ณ ํ์คํํ๋ค๋ฉด, ์ด ๋์ ๊ณต๋ถ์ฐ์ $X$, $Y$์ ๋ํ Correlation๊ณผ ๊ฐ๋ค.
\[\text{Var}(Z, W) = \text{Corr}(X, Y)\]๋ฑ ๋ณด๋ฉด ์ฆ๋ช ํ ์ ์์ ๊ฒ ๊ฐ์์ ๋ฐ๋ก ์ ๋๋ ํ์ง ์๊ฒ ๋ค.
Q1. $\text{Var}(X) = 0$๋ ๋ฌด์์ ์๋ฏธํ๋๊ฐ?
A1.
Q2. $\text{Cov}(X, Y) = 0$์ด์ง๋ง, ๋ RV๊ฐ ๋ ๋ฆฝ์ด ์๋ ์๋ฅผ ์ ์ํ๋ผ.
Q3. Prove that $-1 \le \text{Corr}(X, Y) \le 1$.
Q4. Prove that if $\text{Corr}(X, Y) = 1$, then there exist $a>0$ and $b\in\mathbb{R}$ s.t. $Y = aX + b$.
ํผ์ณ๋ณด๊ธฐ
A1. $p(x)$๊ฐ delta-function์์ ์๋ฏธํ๋ค.
A2. $Y=X^2$์ผ๋ก ์ค์ ํ๋ฉด ์ฝ๊ฒ ๋ณด์ผ ์ ์๋ค. ๋ ๋ฆฝ์์ ๋ณด์ด๊ธฐ ์ํด $p(x, y)$๋ฅผ ๊ตฌํด์ผ ํ ์๋ ์๋๋ฐ, ์ด๊ฒ ์ญ์ ์ ์ ํ ์ ์ค์ ํด์ฃผ๋ฉด ์ฝ๊ฒ reasonableํ๊ฒ ๋์์ธ ํ ์ ์์ ๊ฒ์ด๋ค.
A3. & A4. Q3๋ ์ด๋ฏธ ์์์ ์ฆ๋ช ์ ํ๋ค. ๊ทธ๋ฌ๋ ๋ค๋ฅธ ๋ฐฉ์์ผ๋ก๋ ์ฆ๋ช ํ ์ ์๋ค! ๐ ์ด๊ณณ์ [2, 3]p๋ฅผ ์ฐธ๊ณ ํ๋ผ.
์ด์ด์ง๋ ๋ด์ฉ์์๋ <ํ๊ท >๊ณผ <๋ถ์ฐ>์ ๋ํ ์ฝ๊ฐ์ ์ถ๊ฐ์ ์ธ ๋ด์ฉ์ ์ดํด๋ณธ๋ค.
๊ทธ๋ฆฌ๊ณ Discrete RV์์์ ๊ธฐ๋ณธ์ ์ธ Probability Distribution์ ์ดํด๋ณธ๋ค.
- Bernoulli Distribution
- Binomial Distributions
- Multinomial Distribution
- Hypergeometric Distributions
- etcโฆ