๐ ์ ๋ฒ ์๊ฐ์ MLE์ ๋ํด์ ๋ฐฐ์ ๋ค. ๊ทธ๋ฆฌ๊ณ ์์ ๋ก MLE ๊ธฐ๋ฒ์ logistic regression์ ์ ์ฉํด ์ต์ ์ sigmoid ํจ์๋ฅผ ์ด๋ป๊ฒ ๊ตฌํ๋ ์ง ์ํ์ ์ผ๋ก ์์์ ํตํด ์์๋ณด์๋ค.
๐ ์ด๋ฒ ์๊ฐ์๋ logistic์ด ์๋ normal distribution์ MLE ๊ธฐ๋ฒ์ ์ ์ฉํด ์ฃผ์ด์ง data๋ฅผ ๊ฐ์ฅ ์ ์ค๋ช ํ๋ normal distribution์ ๋ ๋ชจ์์ธ ฮผ์ ฯ๋ฅผ ์ฐพ์ ์ต์ ์ normal distribution์ ์์๋ณด๋ ์๊ฐ์ ๊ฐ์ ธ๋ณด๋ ค ํ๋ค.
Maximum Likelihood Estimation(MLE)
๐ ๋ก์ง์คํฑ ํ๊ท ํฌ์คํ ์์ MLE๊ธฐ๋ฒ์ ํตํด model์ ๊ฒฐ์ ํ๋ค๊ณ ํ์๋ค. ๋ก์ง์คํฑ ํ๊ท์ ์์ ๋ deepํ๊ฒ ์ํ์ ์ผ๋ก ๋ค์ด๊ฐ, ์ด๋ค ๋ชจ๋ธ์ ๊ณ ๋ฅผ ์ง ์์์ผ๋ก ์ฐ์ฐํ๋ ๊ณผ์ ์์ MLE๊ฐ ํต์ฌ์ผ๋ก...
sh-avid-learner.tistory.com
* normal distribution ๊ฐ์>
pr(x|ฮผ,ฯ) = 1ฯโ2ฯ eโ12(xโฮผฯ)2

โ ์ ๊ทธ๋ฆผ์์ ๋ณด๋ฏ์ด distribution์ ์ด๋ ๋ฐฉํฅ์ ฮผ๊ฐ ๊ฒฐ์ ํด์ค๋ค. ๋ถํฌ ์ ์ฒด์ ํ๊ท ์ธ ์ค์ฌ์ ๋ปํ๋ค. ฮผ ๊ฐ์ด ํฌ๋ฉด ์ค๋ฅธ์ชฝ์ผ๋ก ์ด๋, ์์ผ๋ฉด ์ผ์ชฝ์ผ๋ก ์ด๋ํ๋ค.
โ distribution์ ๋๋น, ์ฆ ์ ์์ผ๋ก ํผ์ง ์ ๋๋ ฯ๊ฐ ๊ฒฐ์ ํด์ค๋ค. ฯ ๊ฐ์ด ํด์๋ก ์ ์์ผ๋ก ํผ์ง๊ณ , ์์์๋ก ์๋ก ๋พฐ์กฑํด์ง๋ค.
๐ฟ ์ฐ๋ฆฌ๋ ํด๋น distribution ํจ์๋ฅผ likelihood๋ก ๋์ด ํด๋น likelihood๊ฐ ์ต๋๊ฐ ๋ ๋์ distribution์ ์ฐพ์ผ๋ ค ํ๋ค (๋ ๋ชจ์ ์ฐพ๊ธฐ)
๐ฟ L(ฮผ,ฯ|x) = 1ฯโ2ฯ eโ12(xโฮผฯ)2
๐ฟ speculation) ์ฃผ์ด์ง x data๋ค์ด ์์ ๋, ํด๋น x data๋ค์ ๊ฐ์ฅ ์ ์ค๋ช ํ๋ normal distribution์ ์ฃผ์ด์ง x data์ ํ๊ท ์ด ํด๋น distribution์ ๋ชจ์ ฮผ์ด๊ณ , ์ฃผ์ด์ง x data์ ํ์คํธ์ฐจ๊ฐ distribution์ ฯ๋ผ๊ณ ์ถ์ธกํ ์ ์๋ค.
๐ฟ MLE ๊ธฐ๋ฒ์ผ๋ก ์ฆ๋ช ํด๋ณด์.
* using MLE>
โป ์ฃผ์ - ๋ชจ์๊ฐ 2๊ฐ ์ด์์ธ ๊ฒฝ์ฐ ๊ฐ ๋ชจ์๋ณ๋ก ํธ๋ฏธ๋ถํ ๋, ๋ค๋ฅธ ๋ชจ์๋ constant ์ทจ๊ธํ ์ฑ๋ก ํธ๋ฏธ๋ถ
โ ์ ์ฒด likelihood๋ ๊ฐ x point๋ณ likelihood๋ฅผ ๋ชจ๋ ๊ณฑํ ๊ฐ์ด๋ค
โ L(ฮผ,ฯ|x1,x2,...,xn) = L(ฮผ,ฯ|x1) x L(ฮผ,ฯ|xn) = 1ฯโ2ฯ x eโ12(x1โฮผฯ)2 x ... x 1ฯโ2ฯ x eโ12(xnโฮผฯ)2
โก ๋ฏธ๋ถ์ฐ์ฐ ํธ์๋ฅผ ์ํด ์๋ณ์ ln ๋ก๊ทธ๋ฅผ ์ทจํ๋ฉด
โ ln[L(ฮผ,ฯ|x1,x2,...,xn)] = ln(1ฯโ2ฯ x eโ12(x1โฮผฯ)2 x ... x 1ฯโ2ฯ x eโ12(xnโฮผฯ)2)
โข ์ฐ๋ณ ln์ ์ญ ํ๊ณ ๊ณ์ฐํ๋ฉด
โ = ln(1ฯโ2ฯ x eโ12(x1โฮผฯ)2) + ... + ln(1ฯโ2ฯ x eโ12(xnโฮผฯ)2)
= ln[(2ฯฯ2)โ1/2] - (x1โฮผ)22ฯ2ln(e) + ... + ln[(2ฯฯ2)โ1/2] - (xnโฮผ)22ฯ2ln(e)
= -12ln(2ฯฯ2) - (x1โฮผ)22ฯ2 + ... + -12ln(2ฯฯ2) - (xnโฮผ)22ฯ2
= -12ln(2ฯ) -12ln(ฯ2) - (x1โฮผ)22ฯ2 + ... + -12ln(2ฯ) -12ln(ฯ2) - (xnโฮผ)22ฯ2
= -12ln(2ฯ) -ln(ฯ) - (x1โฮผ)22ฯ2 + ... + -12ln(2ฯ) -ln(ฯ) - (xnโฮผ)22ฯ2
โฃ ๊ณตํต๋ ํญ๋ค์ ๋ฌถ์ด ํํํ๋ฉด ln ์ฐ์ฐ์ ๊ฐ๋จํ๊ฒ ์์ฑํ ์ ์๋ค.
โ = -n2ln(2ฯ) -nln(ฯ) - (x1โฮผ)22ฯ2 - ... - (xnโฮผ)22ฯ2
โค (1) ์ด์ ฮผ์ ๊ดํ ํธ๋ฏธ๋ถ์ ํด๋ณด๋ฉด
โ โโฮผ ln[L(ฮผ,ฯ|x1,x2,...,xn)] = 0 - 0 + x1โฮผฯ2 + ... + xnโฮผฯ2
= 1ฯ2 [(x1+...+xn)โnฮผ]
โฅ (2) ฯ์ ๊ดํ ํธ๋ฏธ๋ถ์ ํด๋ณด๋ฉด
โ โโฯ ln[L(ฮผ,ฯ|x1,x2,...,xn)] = 0 -nฯ + (x1โฮผ)2ฯ3 + ... + (xnโฮผ)2ฯ3 = -nฯ + 1ฯ3[(x1โฮผ)2+...+(xnโฮผ)2]
โฆ ๋ ๋ชจ์์์ ํธ๋ฏธ๋ถ ๊ฐ์ด 0์ผ ๋๋ฅผ ํ์ธ (์ต๋์น์ด๋ฏ๋ก)
โ 1> 0 = 1ฯ2 [(x1+...+xn)โnฮผ]
โ 0 = (x1+...xn)โnฮผ
โ ฮผ = (x1+...xn)n
โ 2> 0 = -nฯ + 1ฯ3[(x1โฮผ)2+...+(xnโฮผ)2]
โ 0 = โn + 1ฯ2[(x1โฮผ)2+...+(xnโฮผ)2]
โ ฯ = โ(x1โฮผ)2+...+(xnโฮผ)2n
โง ๊ฒฐ๊ณผ, ์ต์ ์ ฮผ๋ ์ฃผ์ด์ง data์ ํ๊ท , ์ต์ ์ ฯ๋ ์ฃผ์ด์ง data์ ํ์คํธ์ฐจ์์ MLE ๊ธฐ๋ฒ์ ํตํด ์ฆ๋ช ํ์๋ค!
(์์ speculation์ด ๋ง์์ ํ์ธ ๊ฐ๋ฅ)
* ์ถ์ฒ) ๊ฐ STATQUEST https://www.youtube.com/watch?v=Dn6b9fCIUpM
* ์ฌ์ง, ์ธ๋ฌ์ถ์ฒ) https://www.boost.org/doc/libs/1_49_0/libs/math/doc/sf_and_dist/graphs/normal_pdf.png
'Statistics > Concepts(+codes)' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Maximum Likelihood Estimation(MLE) (0) | 2022.06.26 |
---|---|
Auto-correlation + Durbin-Watson test (0) | 2022.06.17 |
Bayesian Theorem (0) | 2022.05.07 |
distributionใpoisson distribution (ํฌ์์ก๋ถํฌ) (0) | 2022.05.06 |
distributionใbinomial distribution (์ดํญ๋ถํฌ) (0) | 2022.05.06 |
๋๊ธ