๐ฑ ์๋น์ํ ๊ต์ฌ๋ ๋ชจ๋ฅด๊ณ  ์๋ ํ๋ฅ ๋ณ์! ๐ค P([X=1])์ ์๋ฏธ๋ฅผ ์ฐพ์์..

hshยท2021๋ 9์ 3์ผ
7

๋ชฉ๋ก ๋ณด๊ธฐ
2/3

1 ย  $P([X=1])$์ ์๋ฏธ๋ฅผ ์ฐพ์์..

1-1 ๊ฐ์

• ์ฐ๋ฆฌ๋ ํ๋ฅ  ๋ณ์๊ฐ ์ฌ์ค ํจ์๋ผ๋ ์ฌ์ค์ ์ด์ ์ ๋ฐฐ์ ๋ค.
• ๊ทผ๋ฐ ๋ญ๊ฐ ํ๋ฅ  ํจ์๋ก ๋ณด์ด๋ ๊ฒ ์์ $X = 1$ ๋ผ๋ ํํ์ด ์๋ค.
• ํจ์์ธ๋ฐ ๊ดํธ๊ฐ ์๋ต๋ ๊ฒ์ด ์ข ์ง์ฆ๋๋ค.
• ๊ดํธ๊ฐ ์๋ต๋์๋๋ฐ equal ๊ธฐํธ๊ฐ ์๋ ๊ฒ๋ ์ข ์ด์ํ๋ค..
• ์ฅ ์ด๊ฒ ๋ญ์ง..? ๐ค
• $P$๋ ํ๋ฅ  ํจ์๋ก ์ ์์ญ์ด ํ๋ณธ๊ณต๊ฐ์ ๋ถ๋ถ์งํฉ๋ค์ ๋ชจ์ ์ฆ ์ฌ๊ฑด(event)์ ๋ชจ์์ด๋ค.
• ๊ทธ๋ผ $[X=1]$ ์ ์ฌ๊ฑด event ์ด์ฌ์ผ ํ๋ค.
• $[X=1]$์ ์ด๋ค ์งํฉ์ผ๊น..?

1-2 ย  $[X=1]$ ์ ์๋ฏธ

• ๋๋ํ ์ฌ๋ฌ๋ถ์ ๋์น๋ฅผ ์ด๋ฏธ ์ฑ์ ๊ฒ ๊ฐ๋ค.
• ํ์ง๋ง ํ๋ฅ ๋ณ์๊ฐ ํจ์๋ผ๋ ๊ฒ์ ๋ชฐ๋๋ค๋ฉด.., ๋์น ์ฑ์ ์์์๊น..? ใใ ๐คช
• [X = 1]์ ์๋ฏธ๋ X๊ฐ 1์ด ๋๋๋ก ํ๋ ํ๋ณธ๋ค์ ์งํฉ์ด๋ผ๋ ๋ป์ด๋ค.
• ์ฆ ์ด๋๊ฐ์์ ํ๋ฅ  ๋ณ์ = ์ซ์ ๋ผ๋ ํํ์ด ๋์ค๋ฉด ๊ทธ๊ฑด ๊ณง ์งํฉ์ ๋ํ ํํ์ด๋ค
• $[X=t] = \{s \in S | X(s)=t \}$

1-3 ์.. ์์๋ง ์์ผ๋๊น ํ๋ค์ด์

• ์ด์  ์์๋ฅผ ๊ฐ์ ธ์๋ค.
• ํ๋ณธ๊ณต๊ฐ = {๐ง๏ธ, โ๏ธ, โ๏ธ, โ๏ธ}์ด ์๋ค๊ณ  ํ์.
• ์ด๋ ํ๋ฅ  ๋ณ์ X๊ฐ ๋ค์๊ณผ ๊ฐ์ด ์ ์๋์๋ค๊ณ  ํด๋ณด์.
• X(๐ง๏ธ) = -1
• X(โ๏ธ) = -1
• X(โ๏ธ) = -1
• X(โ๏ธ) = 20
• $[X = -1]$ ์ $X(e)$์ ๊ฐ์ $-1$์ด ๋๋๋ก ํ๋ $e$๋ค์ ๋ชจ์์ด๋ค.
• ์ด๋ค $e$๋ค์ด X(e)์ ๊ฐ์ -1๋ก ๋ง๋ค๊น?
• X(๐ง๏ธ) = -1
• X(โ๏ธ) = -1
• X(โ๏ธ) = -1
• { ๐ง๏ธ, โ๏ธ, โ๏ธ }์ด X๋ฅผ -1๋ก ๋ง๋ ๋ค!
• ์ฆ $[X = -1]$ = { ๐ง๏ธ, โ๏ธ, โ๏ธ } ์ด๋ค.

1-4 ์ฐ์ต๋ฌธ์ !

• ํ๋ฅ  ๋ณ์ X๊ฐ ์ ์๋์๋ค.
• X(๐ง๏ธ) = 1
• X(โ๏ธ) = 0
• X(โ๏ธ) = 1
• X(โ๏ธ) = 10
• ์๋๋ ์งํฉ์ ๊ฐ๊ฐ ์ด๋ค ์งํฉ์ธ๊ฐ์?
• $[X=10]$
• $[X=1]$
• $[X=102]$

1-5 ์์ฉ! $[a\leqq X\leqq b]$ ์ ์๋ฏธ

• $[a\leqq X\leqq b]$์ ์๋ฏธ๋ ์์ ๋งค์ฐ ๋น์ทํ๊ฒ ๋ค์๊ณผ ๊ฐ๋ค.
• $[a\leqq X\leqq b] = \{s \in S | a\leqq X(s) \leqq b \}$
• ์์๋ฅผ ๋ค์ด๋ณด๋ฉด ์๋ ์ํฉ์์ $[-1 \leqq X \leqq 14]$ = {๐ง๏ธ, โ๏ธ} ์ด๋ค.
• X(๐ง๏ธ) = -1
• X(โ๏ธ) = 0
• X(โ๏ธ) = 15
• X(โ๏ธ) = 20

2. ํ๋ฅ  ํจ์ $P$ ๋ณต์ตํ๊ธฐ

• ์ฐ๋ฆฌ๋ ์ด์  ๋๋์ด $P([X=1])$ = $P(\{s \in S | X(s)=1 \})$ ์์ ์์๋ค!! ๐ ๐
• ๊ทผ๋ฐ ์  ํ๋ฅ  ํจ์ P๋ ๋ฌด์์ผ๊น? ๐ป
• ๋ณดํต ํต๊ณ์ข ๊ณต๋ถํ๋ค๊ณ  ํ๋ ํ์๋ค์ ์๋์ ๊ฐ์ ๋๋ต์ ํ  ์ ์๋ค.
• ํ๋ฅ  ํจ์๋ ๋ค์ 3๊ฐ์ง ์กฐ๊ฑด์ ๋ง์กฑ์ํค๋ ํจ์์ด๋ค.
1. ํ๋ณธ๊ณต๊ฐ $\Omega$ ์ ๋ถ๋ถ์งํฉ $e \subseteq \Omega$์ ๋ํด์ $0 \leq P(e) \leq 1$ ์ด๋ค.
2. $P(\Omega)$ = 1
3. ์ฌ๊ฑด์ด $E_1, E_2, ...,$์ด ์๋ค๊ณ  ํ์. ์ฌ๊ฑด์ด์ ์๋ก ๊ต์งํฉ์ด ๊ณต์งํฉ์ผ ๋ ( if $\ \ i \neq j\ \ \ then\ \ \ E_i \cap E_j=\phi$) $P(\cup_{i=1}^{\infin}{E_i}) = \sum_{i=1}^{\infin}P({E_i})$์ ๋ง์กฑํ๋ค.

2-1 ๊ทผ๋ฐ P์ ์ ์์ญ, ์น์ญ์ ๋ญ๊น?

• P์ ์ ์์ญ ์น์ญ์ ์๋ ๊ฒ์ P๊ฐ ์ด๋ค ํจ์์ธ์ง ์๋์ง์ ๋งค์ฐ ์ค์ํ๋ค (ํ๋ฅ ๋ณ์์ฒ๋ผ)
• ๊ทผ๋ฐ ๋ฐฐ์ธ๋๋ ์๊ฐ๋ณด๋ค ์ด ๋ถ๋ถ์ ๋์น๋ ๊ฒฝ์ฐ๊ฐ ๋ง๋ค.

2-2 P์ ์ ์์ญ์ ๋ญ๊น?

• P์ ์ ์์ญ์ ํ๋ณธ๊ณต๊ฐ์ ๋ชจ๋  ๋ถ๋ถ์งํฉ์ ๋ชจ์ $F$ ์ฌ๊ฑด ๊ณต๊ฐ(event space) ์ด๋ค.
• ์ฌ๊ฑด์ ๋ญ๊น?
• ์ฌ๊ฑด์ ๋ฐ๋ก ํ๋ณธ๊ณต๊ฐ์ ๋ถ๋ถ์งํฉ์ด๋ค!

2-3 P์ ์น์ญ์ ๋ญ๊น?

• ์น์ญ์ 0์์ 1์ฌ์ด์ ์ซ์์ด๋ค $\{s\in R : 0\leq s \leq 1 \}$

2-4 ์์ ๋ค์ด๋ณด๊ธฐ (example)

• ๊ณ์ ๊ฐ์ ธ์ค๋ ์ฐ๋ฆฌ์ ํ๋ณธ๊ณต๊ฐ {๐ง๏ธ, โ๏ธ, โ๏ธ, โ๏ธ} ๊ฐ ์๋ค๊ณ  ํด๋ณด์
• ์ฌ๊ธฐ์ ์ ์์ญ event_space $F$๋ ์ด๋ป๊ฒ ๋ ๊น?
• event space F๋ ์ด 16๊ฐ์ ์์๊ฐ ์๋๋ฐ ๊ฐ ์์๋ ๋ถ๋ถ์งํฉ์ด๋ค. ๊ฐ ๋ถ๋ถ์งํฉ์ ํฌ๊ธฐ์ ๋ฐ๋ผ ๋๋  ๋ณด๋ฉด ์๋์ ๊ฐ๋ค.
• 0๊ฐ์ผ๋ : {}
• 1๊ฐ์ผ๋ : {๐ง๏ธ}, {โ๏ธ}, {โ๏ธ}, {โ๏ธ},
• 2๊ฐ์ผ๋ : {๐ง๏ธ, โ๏ธ}, {๐ง๏ธ, โ๏ธ}, {๐ง๏ธ, โ๏ธ}, {โ๏ธ,โ๏ธ},{โ๏ธ,โ๏ธ}, {โ๏ธ,โ๏ธ}
• 3๊ฐ์ผ๋ : {๐ง๏ธ, โ๏ธ, โ๏ธ},{๐ง๏ธ, โ๏ธ, โ๏ธ},{๐ง๏ธ,โ๏ธ, โ๏ธ},{โ๏ธ, โ๏ธ, โ๏ธ}
• 4๊ฐ์ผ๋ : {๐ง๏ธ, โ๏ธ, โ๏ธ, โ๏ธ}
• ์ฆ event_space $F$ = {{},{๐ง๏ธ}, {โ๏ธ}, {โ๏ธ}, {โ๏ธ}, {๐ง๏ธ, โ๏ธ}, {๐ง๏ธ, โ๏ธ}, {๐ง๏ธ, โ๏ธ}, {โ๏ธ,โ๏ธ},{โ๏ธ,โ๏ธ}, {โ๏ธ,โ๏ธ}, {๐ง๏ธ, โ๏ธ, โ๏ธ},{๐ง๏ธ, โ๏ธ, โ๏ธ},{๐ง๏ธ,โ๏ธ, โ๏ธ},{โ๏ธ, โ๏ธ, โ๏ธ}, {๐ง๏ธ, โ๏ธ, โ๏ธ, โ๏ธ}} ์ด๋ค.
• P({๐ง๏ธ})๋ ๋น๊ฐ ๋ด๋ฆด ํ๋ฅ ์ด ๋๋ ๊ฒ์ด๊ณ  P({๐ง๏ธ,โ๏ธ, โ๏ธ})๋ ๋น๋ ๊ตฌ๋ฆ, ๋์ด ๋ด๋ฆด ํ๋ฅ ์ธ๊ฒ์ด๋ค.

2-5 ์์ฃผ์ฐ๋ ๊ด์ฉ?์ ํํ

• ์ฐธ๊ณ ๋ก ์ด์  1ํธ์์ ์์๋ก๋  P(โ๏ธ) = .3, P(โ๏ธ) = .5, P(โ๏ธ) = .1 ๋ ์๋ฐํ ํ๋ฆฐ ํํ์ด๋ค.

Question! ์ ํํ์ ์ ํ๋ฆฐ๊ฑธ๊น?

• 2-1-1 P์ ์ ์์ญ์ ๋ญ๊น? ์์ ๋ค๋ฃฌ๊ฒ ์ฒ๋ผ P์ ์ ์์ญ์ ์ฌ๊ฑด๊ณต๊ฐ์ด๋ค. ๋ฐ๋ผ์ P์๋ ํ๋ณธ๊ณต๊ฐ์ ๋ถ๋ถ์งํฉ๋ง ์ฌ ์ ์๋ค. ํ์ง๋ง ์ ํํ์ ๋ถ๋ถ ์งํฉ์ด ์๋ ํ๋ณธ(sample)์ด ๋ค์ด์๋ค.
• ๋ถ๋ถ์งํฉ์ด๋ผ๋ ๊ฒ์ ํํํ P({โ๏ธ}) = .3, P({โ๏ธ}) = .3,P({โ๏ธ}) = .3 ์ด ๋ง๋ ํํ์ด๋ค.
• ํ์ง๋ง ๋ง์ ์ฌ๋๋ค์ด ๋์ฒ๋ผ ํ๋ฆฌ๊ฒ ์ด๋ค.
• (์๋๊ณ ? ๊ดํธ์ฐ๊ธฐ ๊ท์ฐฎ์ผ๋๊น..๐ ๊ต์๋๋ ๊ทธ๋ ๊ฒ ์ฐ๋๊ณ ๋ณด๊ณ ..๐ ํธํ๋๊น..๐ ใใ..)

2-1-6 ์ ์์ญ์ ํฌ๊ธฐ(๊ฐ์)

• ํ๋ณธ๊ณต๊ฐ์ด ํ๋ณธ์ ๊ฐ์(=n)๊ฐ ์ ํด์ ธ์๋ค๋ฉด ๊ฐ๋จํ ์์ด ์กฐํฉ ๊ณต์์ ๋ฐ๋ผ $2^n$๊ฐ ์๋ค๋ ๊ฒ์ ์ ์ ์๋ค.
• ์ ์ดํด๊ฐ ์ ๋๋ค๋ฉด ์คํ๊ต ๊ต๊ณผ์์๋ ์๊ฐ๋๋ ๋ฉฑ์งํฉ(power set)์ ๊ฐ์๋ก ๊ฒ์ํด๋ณด๋ฉด ๋๋ค.
• ํ๋ณธ๊ณต๊ฐ์ด ํ๋ณธ์ ๊ฐ์๊ฐ ๋ฌดํํ๋ฉด event_space์ ํฌ๊ธฐ๋ ๋ฌดํํ๋ค.

3. ์ ๋ฆฌ

• ์ฐ๋ฆฌ๋ ๋๋์ด..! $P([X=-1])$์ ์๋ฏธ๋ฅผ ํ๋ฅ ๋ณ์๊ฐ ํจ์๋ผ๋ ๊ด์ ์์ ์ดํดํ  ์ ์๊ฒ๋์๋ค!!
• X(๐ง๏ธ) = -1
• X(โ๏ธ) = -1
• X(โ๏ธ) = -1
• X(โ๏ธ) = 20
• P({โ๏ธ}) = .3, P({โ๏ธ}) = .3,P({โ๏ธ}) = .3, P({๐ง๏ธ})=.1 ์ด๋ผ๋ฉด
• $P([X=-1])$ = $P(\{$โ๏ธ, โ๏ธ, ๐ง๏ธ$\})$ = $.3 + .3 + .1$ = $0.7$ ์ธ ๊ฒ์ด๋ค.
• ์์ ๊ฐ์๊ณผ์ ์ด ์ฌ์ค ์ ๋ฐ ํํ์ ๋ณผ๋๋ง๋ค ์ฐ๋ฆฌ ๋์์์ ๊ณ์ฐ๋๋ ๊ฒ์ด๋ค.
• ๋ง์ฝ์ ํ๋ฅ  ๋ณ์๋ฅผ ํจ์๊ฐ ์๋ ๋ณ์ ๋ก ์ค๋ชํ๋ค๋ฉด $P([X=-1])$ ์ ๊น๋ํ๊ฒ ์ค๋ชํ  ์ ์์๊น? ๊ฐ์ธ์ ์ผ๋ก๋ ๋ถ๊ฐ๋ฅํ  ๊ฒ์ด๋ผ๊ณ  ๋ณธ๋ค.
• ์ฃผ์ฌ์์ ๋๊ธ์ ์๋ฅผ ํ๋ฅ ๋ณ์๋ก ํ๋ค๋ฉด, P(X=2)์ ์จ๊ฒจ์ง ์๋ฏธ๋ ํ๋ณธ๊ณต๊ฐ์ ๋ถ๋ถ์งํฉ์ผ๋ก ํํ๋๋ P({โ}) ์๋ ๊ฒ์ด๋ค.

ํต๊ณํ์ ํ๋ฅ ์ ์ฌ์ค ํ๋ณธ๊ณต๊ฐ์์ ๋ถํฐ ์์๋๋ ๊ฐ๋์ด๋ค.
ํต๊ณํ์ ๋ฐฐ์ธ ๋ ์ด๋ค ๊ฐ๋์ด๋  ํ๋ณธ๊ณต๊ฐ๊ณผ ๊ด๋ จ์ง์ด ์๊ฐํ  ์ ์์ด์ผ ํ๋ค.

4. ๋ค์ํธ.. ์๊ณ

• ์ฌ์ค ์๋์ ๊ฐ์ ํํ๋ ์ ๋ถ 2ํธ์์ ๋ค๋ฃจ๊ณ  ๋๋ด๋ ค๊ณ  ํ๋๋ฐ, ํ๋ฒ์ ํ๋ ค๋ ํ๋๋ค๊ณ ...์ฐ๋ค๊ฐ ํ๋ฒ ํต์งธ๋ก ๋ ๋ ค๋จน์ผ๋ ์์๋ ์ ์  ์์ด์ง๋๋ผ๊ณ ์..
• ๋ค๋ฃจ๊ณ  ์ถ์๋ ๋ด์ฉ๋ค..
• E[X]
• E[E[X|Y]]
• $Z=F(X,Y,..)$
• $P_{F(X,Y,..)}(x)$
• ์ ๋ถํ๋ ค๋ค ๋ณด๋ ๊ธ ๋ด์ฉ๋ ์๊ฐ๋ณด๋ค ๊ธธ์ด์ง ๊ฒ ๊ฐ๊ณ , ๋ ์ฌ๋ฐ๊ฒ ์ฐ๋ ๊ฒ๋ ์ฌ์ฌ ํ๊ณ๊ฐ ์ค๋ ๊ฒ ๊ฐ๊ณ ์ ใใ
• ๊ทธ๋์ ์ด๋ง ์ฌ๊ธฐ์ ๋๋ด๊ณ  3ํธ์์๋ ํ๋ฅ ๋ณ์ ์ฌ์ด์ ์ฐ์ฐ $Z=F(X,Y,..)$์ ๋ค๋ค๋ณผ๊น ํฉ๋๋ค.
• ๊ธ์ด ๋์์ด ๋์จ๋ค๋ฉด ๋ธ๋ก๊ทธ๊ธ ์์ ์๋ ํํธ๋ชจ์ ์์ด์ฝ์ ๋๋ฌ์ฃผ์ธ์.
• ๊ธฐ๋ํด์ฃผ์ธ์.
Machine Learning Engineer: recsys, mlops

1๊ฐ์ ๋๊ธ

2021๋ 9์ 11์ผ

๐๐ป๐๐ป๐๐ป๐๐ป๐๐ป

๋ต๊ธ ๋ฌ๊ธฐ