-
1. 확률이란?
-
2. 확률 이론 기초
-
1) Random Variable
-
2) Fundamental rules
-
3) Bayes rule
-
4) Independence and conditional independence
-
5) Continuous random variables
-
6) Mean and variance
-
3. 대표적인 확률 분포
-
1) discrete distributions
-
2) continuous distributions
-
4. 결합 확률 분포
-
1) Covariance and correlation
-
2) multivariate Gaussian
-
5. Transformations of random variables
-
1) Linear transformations
-
2) Central Limit Theorem(중심극한정리)
-
6. Monte Carlo approximation
확률 기초 이론을 정리해두고자 한다. 머피 책 Machine Learning - A Probabilistic Perspective, 위키피디아를 참고하였다.
1. 확률이란?
Probability theory is nothing but common sense reduced to calculation. — Pierre Laplace, 1812
확률(probability)에는 두 가지 관점이 있다.
- frequentist interpretation: it defines an event's probability as the limit of its relative frequency in many trials (the long-run probability)
- Bayesian interpretation: probability is used to quantify our uncertainty about something; hence it is fundamentally related to information rather than repeated trials
2. 확률 이론 기초
1) Random Variable

- mathematical formalization of a quantity or object which depends on random events
- a mapping or a function from possible outcomes in a sample space to a measurable space, often the real numbers
- Discrete or Continuous
2) Fundamental rules
◉ Probability of a union of two events
$\begin{array}{rcl}
P(A \cup B) & = & P(A) + P(B) - P(A\cap B) \\
& = & P(A) + P(B). \ \text{if A and B are mutually exclusive}
\end{array}$
◉ Joint probabilities
- product rule: $p(A,B) = p(A \cap B) = p(A|B)P(B)$
- marginal distribution: $p(A)=\sum_{b}p(A,B) = \sum_{b}p(A|B=b)p(B=b)$ (rule of total probability)
- chain rule: $p(X_{1:D}) = p(X_{1})p(X_{2}|X_{1})p(X_{3}|X_{2},X_{1})p(X_{4}|X_{1},X_{2},X_{3})\cdots p(X_{D}|X_{1:D-1})$
◉ Conditional probability
$p(A|B) = \frac{p(A,B)}{p(B)} \ \text{.if} \ p(B) > 0$
3) Bayes rule
$p(X=x|Y=y) = \frac{p(X=x, Y=y)}{p(Y=y)} = \frac{p(X=x)p(Y=y|X=x)}{\sum_{\acute{x}}p(X=\acute{x})p(Y=y|X=\acute{x})}$
4) Independence and conditional independence
두 확률변수 $X,Y$가 독립(unconditionally independent, marginally independent)일 때, 결합확률분포를 marginal 확률의 곱으로 표현할 수 있다.
$X \perp Y \ \Leftrightarrow \ p(X,Y)=p(X)p(Y)$
두 확률변수 $X,Y$가 $Z$에 대해 독립일 때(conditionally independent)일 때, 결합확률분포를 conditional margiinal 확률의 곱으로 표현할 수 있다.
$X \perp Y |Z \ \Leftrightarrow \ p(X,Y|Z)=p(X|Z)p(Y|Z)$
5) Continuous random variables
확률변수 $X$의 cumulative distribution function을 $F(q) = p(X\le q)$이라고 하자. 구간 $(a,b]$의 확률은 $p(a < X\le b)=F(b)-F(a)$로 표현할 수 있다. 이때 $f(x)= \frac{d}{dx}F(x)$인 $f$를 probability density function이라고 하며 확률을 다음과 같이 정의할 수 있다.
$p(a < X\le b) = \int_{a}^{b}f(x)dx$
6) Mean and variance
◉ mean
평균은 확률변수 $x$의 기대값(expected value)이다.
$\mu = \mathbb{E}[x] = \sum_{x \in x}x \cdot p(x)$
◉ variance
분산은 확률변수 $x$의 퍼짐의 정도이다('spread' of distribution).
$\begin{array}{rcl}
\sigma^{2} \ = \ \text{var}[X] & = & \mathbb{E}[(X-\mu)^{2}] \\
& = & \int(x-\mu)^{2}p(x)dx \ = \ \mathbb{E}[X^{2}]-\mu^{2} \\
\end{array}$
3. 대표적인 확률 분포
1) discrete distributions
◉ Bernoulli and binomial distributions
$\begin{array}{rcl}
Ber(x|\theta) & = & \theta^{\mathbb{I(x=1)}}(1-\theta)^{\mathbb{I}(x=0)} \\
& = & \left\{ \begin{array}{cl}
\theta & \text{if} \ x = 1 \\
1-\theta & \text{if} \ x = 0
\end{array} \right.
\end{array}
$
$Bin(k|n,\theta) = \binom{n}{k}\theta^{k}(1-\theta)^{n-k}, \text{where} \ \binom{n}{k}=\frac{n!}{(n-k)!k!}$
◉ Poisson distribution
$Poi(x|\lambda) = e^{-\lambda}\frac{\lambda^{x}}{x!}$
◉ empirical distribution
$\begin{array}{rcl}
p_{emp}(A) & = &\frac{1}{N}\sum^{N}_{i=1}\delta_{x_{i}}(A) \\
\delta_{x}(A) & = & \left\{ \begin{array}{cl}
1 & \text{if} \ x \in 0 \\
0 & \text{if} \ x \notin 0
\end{array} \right. \\
\end{array}
$
2) continuous distributions
◉ Gaussian (normal) distribution
$\mathcal{N}(x|\mu, \sigma^{2}) = \frac{1}{\sqrt{2\pi\sigma^{2}}}e^{-\frac{1}{2\sigma^{2}}(x-\mu)^{2}}$
◉ Laplace distribution
$Lap(x|\mu, b) = \frac{1}{2b}e^{-\frac{|x-\mu|}{b}}$
4. 결합 확률 분포
1) Covariance and correlation
◉ covariance
$\text{cov}[X,Y] = \mathbb{E}[(X-\mathbb{E}[X])(Y-\mathbb{E}[Y])] = \mathbb{E}[XY] - \mathbb{E}[X]\mathbb{E}[Y]$
◉ covariance matrix
$
\begin{array}{rcl}
\text{cov}[\textbf{x}] & = &\mathbb{E}[(\textbf{x}-\mathbb{E}[\textbf{x}])(\textbf{x}-\mathbb{E}[\textbf{x}])^{T}]
\\
& = &\begin{pmatrix}
\text{var}[X_{1}] & \text{cov}[X_{1}, X_{2}] & \cdots & \text{cov}[X_{1}, X_{d}] \\
\text{cov}[X_{2}, X_{1}] & \text{var}[X_{2}] & \cdots & \text{cov}[X_{2}, X_{d}] \\
\vdots & \vdots & \ddots & \vdots \\
\text{cov}[X_{d}, X_{1}] & \text{cov}[X_{d}, X_{2}] & \cdots & \text{var}[X_{d}]
\end{pmatrix} \\
\end{array}$
◉ Pearson correlation coefficient
$\text{corr}[X,Y] = \frac{\text{cov}[X,Y]}{\sqrt{\text{var}[X]\text{var}[Y]}}$
$\textbf{R} = \begin{pmatrix}
\text{corr}[X_{1},X_{1}] & \text{corr}[X_{1},X_{2}] & \cdots & \text{corr}[X_{1},X_{d}] \\
\vdots & \vdots & \ddots & \vdots \\
\text{corr}[X_{d},X_{1}] & \text{corr}[X_{1},X_{2}] & \cdots & \text{corr}[X_{d},X_{d}]
\end{pmatrix}$
2) multivariate Gaussian
$\mathcal{N}(\textbf{x}|\mu, \Sigma) = \frac{1}{(2\pi)^{D/2}|\Sigma|^{1/2}}\text{exp}\left[ -\frac{1}{2} (\textbf{x}-\mu)^{T}\Sigma^{-1}(\textbf{x}-\mu) \right]$
5. Transformations of random variables
1) Linear transformations
$f()$를 $\textbf{y} = f(\textbf{x}) = A\textbf{x} + \textbf{b}$와 같은 linear funcion이라고 하자. 이때 $\textbf{y}$의 mean, covariance는 다음과 같이 정의할 수 있다.
- $\mathbb{E}[\textbf{y}] = \mathbb{E}[A\textbf{x}+\textbf{b}] = A\mu + \textbf{b}$
- $\text{cov}[y] = \text{cov}[A\textbf{x}+\textbf{b}] = A\Sigma A^{T}, \ \Sigma = \text{cov}[\textbf{x}]$
2) Central Limit Theorem(중심극한정리)
CLT는 어떤 집단(population)이 있을 때 해당 집단의 분포가 아닌 집단의 sampling distribution에 관한 정리이다. 어떤 집단의 분포를 모르는 상황에서 ➀매번 $N$개의 sample을 i.i.d.(independent and identically distributed)하게 뽑고 ➁각 sample들의 평균을 계산한다고 하자. 그리고 $S_{N} = \sum^{N}_{i=1}X_{i}$라는 새로운 random variable을 정의하고, 각 sample mean을 $\bar{X}=\frac{1}{N}\sum^{N}_{i=1}x_{i}$이라는 random variable로 정의하자. 이때 $N$이 커질수록 $S_{N}$은 다음의 분포를 따른다.
$p(S_{N}=s) = \frac{1}{\sqrt{2\pi N \sigma^{2}}}exp\left(-\frac{(s-N_{u})^{2}}{2N\sigma^{2}} \right)$
이때 $Z_{N} = \frac{S_{N}-N_{u}}{\sigma\sqrt{N}} = \frac{\bar{X}-\mu}{\sigma\sqrt{N}}$이라는 random variable은 standard normal distribution으로 수렴한다.

위 내용은 책의 설명인데 조금 어렵게 설명되어있는 듯 하다. CLT의 핵심은 다음과 같다(참고).
sampling distribution of the mean will always be normally distributed, as long as the sample size is large enough. Regardless of whether the population has a normal, Poisson, binomial, or any other distribution, the sampling distribution of the mean will be normal.
모집단(population)의 평균을 $\mu$, 표준편차를 $\sigma$라고 하자. 이때 sampling distribution의 평균과 분산은 각각 다음과 같다.
$\begin{array}{rcl}
\mu_{\bar{x}} & = &\mu\\
\sigma_{\bar{x}} & = & \frac{\sigma}{\sqrt{n}}
\end{array}$
이때 samping distribution of the mean은 $\bar{X} \sim N(\mu, \frac{\sigma}{\sqrt{n}})$와 같은 분포를 따른다.
그럼 CLT는 언제쓰냐? 글1, 글2과 같이 모집단의 분포 정보($\mu, \sigma$)를 추정하고, 이를 활용하여 hypothetical testing 등에 활용된다.
6. Monte Carlo approximation
몬테카를로 방법(Monte Carlo method)은 반복된 무작위 추출(repeated random sampling)을 이용하여 함수의 값을 수리적으로 근사하는 알고리즘을 부르는 용어이다.
일반적으로 어떤 random variable $X$가 있을 때, 이에 대한 함수 $f(X)$를 계산하는 것은 어렵다. 이를 수학적으로 계산하기 위해서 Monte Carlo approximation을 사용할 수 있다. 먼저 ➀$f(X)$로 부터 $S$개의 sample $x_{1}, \cdots, x_{S}$를 얻는다. ➁그리고 empirical distribution $\{f(x_{s})\}^{S}_{s=1}$를 사용하여 $f(X)$의 분포를 추정한다.

Monte Carlo approximation를 사용하면 어떠한 function of a random variable이 있어도 expected value를 추정할 수 있다. 예를 들어 sample들을 통해 함수의 수학적 평균을 다음과 같이 계산할 수 있다.
$\mathbb{E}[f(X)] = \int f(x)p(x)dx \approx \frac{1}{S}\sum^{S}_{s=1}f(x_{s}), \ \text{where} \ x_{s} \sim p(X)$
뿐만 아니라 아래와 같이 다양한 quantity를 추정할 수 있다.
- $\bar{x} = \frac{1}{S}\sum^{S}_{s=1}x_{s} \rightarrow \mathbb{E}[X]$
- $ \frac{1}{S}\sum^{S}_{s=1}(x_{s}-\bar{x})^{2} \rightarrow \text{var}[X]$
- $ \frac{1}{S} \# \{x_{s}\le c\} \rightarrow P(X\le c)$
- $\text{median}\{x_{1}, \cdots, x_{S} \} \rightarrow \text{median}(X)$
Monte Carlo는 수학적 분석에서도 많이 사용된다(참고: Monte Carlo integration)
'통계이론' 카테고리의 다른 글
Bayesian view of the probability (0) | 2023.01.21 |
---|
확률 기초 이론을 정리해두고자 한다. 머피 책 Machine Learning - A Probabilistic Perspective, 위키피디아를 참고하였다.
1. 확률이란?
Probability theory is nothing but common sense reduced to calculation. — Pierre Laplace, 1812
확률(probability)에는 두 가지 관점이 있다.
- frequentist interpretation: it defines an event's probability as the limit of its relative frequency in many trials (the long-run probability)
- Bayesian interpretation: probability is used to quantify our uncertainty about something; hence it is fundamentally related to information rather than repeated trials
2. 확률 이론 기초
1) Random Variable

- mathematical formalization of a quantity or object which depends on random events
- a mapping or a function from possible outcomes in a sample space to a measurable space, often the real numbers
- Discrete or Continuous
2) Fundamental rules
◉ Probability of a union of two events
◉ Joint probabilities
- product rule:
- marginal distribution:
(rule of total probability) - chain rule:
◉ Conditional probability
3) Bayes rule
4) Independence and conditional independence
두 확률변수
두 확률변수
5) Continuous random variables
확률변수
6) Mean and variance
◉ mean
평균은 확률변수
◉ variance
분산은 확률변수
3. 대표적인 확률 분포
1) discrete distributions
◉ Bernoulli and binomial distributions
◉ Poisson distribution
◉ empirical distribution
2) continuous distributions
◉ Gaussian (normal) distribution
◉ Laplace distribution
4. 결합 확률 분포
1) Covariance and correlation
◉ covariance
◉ covariance matrix
◉ Pearson correlation coefficient
2) multivariate Gaussian
5. Transformations of random variables
1) Linear transformations
2) Central Limit Theorem(중심극한정리)
CLT는 어떤 집단(population)이 있을 때 해당 집단의 분포가 아닌 집단의 sampling distribution에 관한 정리이다. 어떤 집단의 분포를 모르는 상황에서 ➀매번
이때

위 내용은 책의 설명인데 조금 어렵게 설명되어있는 듯 하다. CLT의 핵심은 다음과 같다(참고).
sampling distribution of the mean will always be normally distributed, as long as the sample size is large enough. Regardless of whether the population has a normal, Poisson, binomial, or any other distribution, the sampling distribution of the mean will be normal.
모집단(population)의 평균을
이때 samping distribution of the mean은
그럼 CLT는 언제쓰냐? 글1, 글2과 같이 모집단의 분포 정보(
6. Monte Carlo approximation
몬테카를로 방법(Monte Carlo method)은 반복된 무작위 추출(repeated random sampling)을 이용하여 함수의 값을 수리적으로 근사하는 알고리즘을 부르는 용어이다.
일반적으로 어떤 random variable

Monte Carlo approximation를 사용하면 어떠한 function of a random variable이 있어도 expected value를 추정할 수 있다. 예를 들어 sample들을 통해 함수의 수학적 평균을 다음과 같이 계산할 수 있다.
뿐만 아니라 아래와 같이 다양한 quantity를 추정할 수 있다.
Monte Carlo는 수학적 분석에서도 많이 사용된다(참고: Monte Carlo integration)
'통계이론' 카테고리의 다른 글
Bayesian view of the probability (0) | 2023.01.21 |
---|