Maximum Likelihood Estimation
Parametric Inference
λ€μκ³Ό κ°μ λ¬Έμ λ₯Ό μκ°ν©λλ€.
Problem : Parametric Inference
λ°μ΄ν° $x_1, x_2, \dots x_n$ μ΄ μκ³ , μ΄λ€μ΄ μ΄λ€ λΆν¬ $f(x ; \theta)$ λ‘λΆν° μΆμΆλμμμ μκ³ μλ€. μ΄λ, $x_1, \dots x_n$ μΌλ‘λΆν° $\theta$λ₯Ό μΆμΈ‘νκ³ μΆλ€.
μλ₯Ό λ€μ΄, λ€μκ³Ό κ°μ λ°μ΄ν°λ₯Ό μ΄λ€ μ κ· λΆν¬ $\mathcal{N}(\mu, \sigma^2)$ λ‘λΆν° μΆμΆνλ€κ³ κ°μ νκ² μ΅λλ€.
[ 6.52615303, 12.4042103 , 12.71258848, 14.6846982 , 12.88396983,
7.65825908, 10.2504715 , 9.01303742, 16.79015299, 10.74596275,
12.08337416, 5.09596278, 6.13636642, 14.98837882, 17.40270976,
11.49500769, 9.77796779, 11.61802914, 15.90435845, 8.1379665 ]
μ΄λ, μ°λ¦¬λ μ λ ₯μ΄ μ κ·λΆν¬λ₯Ό λ°λ¦μ μκ³ μμΌλ, $\mu$ μ $\sigma$λ λͺ¨λ¦ λλ€. λ°μ΄ν°λ‘λΆν° κ±°κΎΈλ‘ unknown parameter $\mu, \sigma$μ κ°μ μ΄λ»κ² μΆλ‘ νλ©΄ μ’μκΉμ? μ°Έκ³ λ‘, μ λ΅μ νκ· 12, νμ€νΈμ°¨ 3 (λΆμ° 9)μ λλ€. κΈ λ§λ¬΄λ¦¬μμ μ΄ μ 보λ₯Ό νμ©νμ§ μκ³ μ΄λ₯Ό μΆλ‘ ν κ²μ λλ€.
Likelihood
Likelihood (λ²μμ΄λ βμ°λβ μ λλ€. μμΈμ§λ λͺ¨λ₯΄κ² μ΅λλ€) $L(\theta \di x)$ λ, λ€μκ³Ό κ°μ΄ μ μν©λλ€. \(L(\theta \di x) = \P(X = x; \theta)\) μ¦, unknown parameter $\theta$κ° μ νν $\hat{\theta}$ μΌ λ, $X = x$ μΌ νλ₯ μ $L(x, \hat{\theta})$λ‘ μ μνλ€λ μλ―Έκ° λ©λλ€.
λ°μ΄ν° $N$κ°κ° μ£Όμ΄μ§ λ, μ΄λ€μ νλ₯ μ΄κΈ° λλ¬Έμ, νλ₯ μ κ³±μ μκ°ν¨μ΄ μμ°μ€λ½μ΅λλ€. \(\mathcal{L}(\theta) = \prod_{i = 1}^{N} L(\theta \di x_i)\) μ¦, $\mathcal{L}(\theta)$λ₯Ό μ μμμ μ μ©νλ©΄, $\mathcal{L}(\mu=2, \sigma=1)$ μ΄λΌλ κ°μ βνκ· μ΄ 2, νμ€νΈμ°¨κ° 1μΈ μ κ·λΆν¬μμ μν 20κ°λ₯Ό μΆμΆνμ λ μ°λ¦¬κ° μ νν μμ κ°μ μνμ μ»μ νλ₯ β μ΄λΌκ³ ν΄μν μ μμ΅λλ€.
μ§κ΄μ μΌλ‘, μ΄ νλ₯ μ maximizeνλ κ²μ΄ κ°μ₯ μμ°μ€λ¬μ΄ λ°©ν₯μμ μ μ μμ΅λλ€. βParameterκ° $\theta$μΌ λ λ°μ΄ν°κ° μ΄λ κ² μκ²Όμ κ°λ₯μ±β μ΄ λμ $\theta$λ₯Ό μ°Ύλ κ²μ΄ κ³§ βλ°μ΄ν°κ° μ΄λ κ² λμμ λ parameterκ° $\theta$μΌ κ°λ₯μ±β μ λμ¬μ€λ€λ κ²μ λλ€. μ΄λ μ°λ¦¬κ° β$\theta$μ λν΄ μ¬μ μ μκ³ μλ μ λ³΄κ° μλ€λ©΄β κ°μ₯ ν©λ¦¬μ μΈ κ²μ²λΌ 보μ λλ€ (λ¬Όλ‘ μ¬μ μ $\theta$μ λν prior μ λ³΄κ° μλ€λ©΄ μ΄ κ°μ μ΄ ν©λΉνμ§ μμ μ μμ΅λλ€)
μ°Έκ³ λ‘, νμλ νλ₯ λΆν¬κ° λ§μ§λ§ ($\theta$μ λΆν¬), μ μλ μ¬μ€ νλ₯ λΆν¬λ μλλΌλ μ μ λλ€. (μ΄ κ°μ νλ₯ λ‘ μ€ν΄ν΄μ λ°μνλ μ€λ₯λ₯Ό Prosecutorβs fallacy λΌκ³ λΆλ¦ λλ€.)
Maximum Likelihood Estimation : μμ
μ΄μ , μ likelihood function \(\mathcal{L}(\theta) = \prod_{i = 1}^{N} L(\theta \di x_i)\) μ΄λ₯Ό maximizeνλ $\theta$λ₯Ό μ°Ύλ κ²μ Maximum Likelihood Estimation μ΄λΌκ³ λΆλ¦ λλ€.
κ³±μ μ΅μννλ κ²μ κ³μ°μ μΌλ‘ μλΉν μ΄λ ΅μ΅λλ€.1 λ°λΌμ, μ€μ computationμμλ log-likelihoodλ₯Ό μκ°ν©λλ€. \(\log \mathcal{L}(\theta) = \sum_{i = 1}^{N} \log L(\theta \di x_i)\)
λ€μ μ κ·λΆν¬μ μΌμ΄μ€λ‘ λμκ° λ³΄κ² μ΅λλ€. λ¨Όμ , Likelihood κ³μ°μ λ€μκ³Ό κ°μ΄ κ°λ₯ν©λλ€. \(L((\mu, \sigma^2) \di x_i) = \frac{1}{\sigma \sqrt{2\pi}}\exp\left(-\frac{(x_i-\mu)^2}{2\sigma^2}\right)\) λ°λΌμ, μ°λ¦¬λ λ€μμ μ΅λννκ³ μ ν©λλ€. \(\underset{\mu \in \R, \sigma \in \R}{\maximize} \log \mathcal{L}(\mu, \sigma^2) = \sum_{i = 1}^{N} \left(- \log \sigma - \log \sqrt{2\pi} -\frac{(x_i-\mu)^2}{2\sigma^2}\right)\) κ·Έλ°λ°, $\log \sqrt{2\pi}$ λ μ΄μ°¨νΌ $\mu$, $\sigma$λ μ무 κ΄λ ¨μ΄ μκ³ , λΆνΈλ₯Ό λ°κΎΈλ©΄ μ΅λνκ° μ΅μνκ° λλ―λ‘, μ΄ λ¬Έμ λ λ€μκ³Ό κ°μ΄ λ€μ μΈ μ μμ΅λλ€. \(\underset{\mu \in \R, \sigma \in \R}{\minimize} - \log \mathcal{L}(\mu, \sigma^2) = N \log \sigma + \frac{1}{2\sigma^2} \sum_{i = 1}^{N} (x_i - \mu)^2\)
μ΄λ₯Ό μ΅μννλ κ²μ κ·Έλ₯ λ€λ³μν¨μ μ΅μ ν λ¬Έμ μ΄κ³ , νΈλ―ΈλΆμ ν΅ν΄ κ·Ήκ°μ μ°Ύμ μ μμ΅λλ€. νΈνκ² ν¨μλ₯Ό $\ell$ μ΄λΌκ³ μ°λ©΄, \(\pdv{\ell}{\mu} = \sum_{i = 1}^{N} 2(x_i - \mu) = 0\) λ°λΌμ, $\mu = \frac{1}{N} \sum_{i = 1}^{N} x_i$ μΌ λ $\pdv{\ell}{\mu} = 0$ μ λλ€. μ¦ βμλ λΆν¬μ νκ· κ°μ λν ν©λ¦¬μ μΆμ μΉλ‘ νλ³Ένκ· μ μ¬μ©ν μ μμβμ μλ―Έν©λλ€. 2
κ°μ λ°©λ²μΌλ‘, $\sigma$μ λν΄μλ λ°λ³΅ν©λλ€. \(\pdv{\ell}{\sigma} = \frac{N}{\sigma} - \frac{1}{\sigma^3} \sum_{i = 1}^{N} (x_i - \mu)^2 = 0\) \(\sigma^2 = \frac{1}{N}\sum_{i = 1}^{N} (x_i - \mu)^2\) βμλ λΆν¬μ λΆμ°μ λν ν©λ¦¬μ μΆμ (MLE) μΉλ‘ νλ³ΈλΆμ° μ μ¬μ©ν μ μμβμ μλ―Έν©λλ€.
μ λ°μ΄ν°μ μ΄λ₯Ό μ μ©νλ©΄, νλ³Ένκ· 11.3κ³Ό νλ³ΈλΆμ° 12.01μ μ»μ΅λλ€. λ°μ΄ν°κ° μ μ΄ μ ννμ§λ μμ§λ§, νκ· μ λν΄ νλ³Ένκ· μ, λΆμ°μ λν΄ νλ³ΈλΆμ°μ μ°λ κ²μ ν©λ¦¬μ μΈλ― 보μ λλ€.
Further Discussion
μ΅λ μ°λ μΆμ (Maximum Likelihood Estimation) μ λΆλͺ λ£κΈ°μ ν©λ¦¬μ μ΄μ΄ 보μ΄κ³ , μ€μ λ‘λ κ°μ₯ λ§μ΄ νμ©λλ μΆμ λ°©λ²μ λλ€.
κ·Έλ¬λ, μλ²½νμ§λ μμ΅λλ€. λνμ μΌλ‘ λ°©κΈ λ³Έ μ κ·λΆν¬μ λΆμ° μΆμ μμ MLEλ unbiasednessλ₯Ό λ§μ‘±νμ§ μμ΅λλ€. μ΄κ² λ¬΄μ¨ λ§μ΄λλ©΄β¦
- μ°λ¦¬κ° κ°μ λΆν¬μμ μΆμΆνκ³ , λ°μ΄ν°λ₯Ό ν΅ν΄ inference νλ νλμ λ°©κΈ ν λ² νμ΅λλ€.
- λ§μ½ μ΄ κ³Όμ μ $K$λ² λ°λ³΅ν μ μλ€λ©΄, μ¦ λΆμ°μ νλ² μΆμ νλκ² μλλΌ, $N$κ°μ λ°μ΄ν°λ₯Ό λͺ¨μμ κ·Έλ‘λΆν° λΆμ°μ μΆμ νλ νλ μ체λ₯Ό $K$λ² ν΄μ $\sigma_1 \dots \sigma_K$ λ₯Ό λ§λ λ€λ©΄?
- μ§κ΄μ μΌλ‘ μ°λ¦¬λ $\E[\hat{\sigma}] = \sigma$, μ¦ μ΄ λ°μ΄ν°λ‘λΆν° μ»μ μΆμ $\sigma$ λ€μ κΈ°λκ°μ΄ μ νν μλμ λΆμ°μ΄ λκΈ°λ₯Ό λ°λλλ€.
- κ·Έλ¬λ, κ³μ°ν΄λ³΄λ©΄ κ·Έλ μ§ μμ΅λλ€. νΉμ μ°λ¦¬κ° κ³ λ±νκ΅λ λν 1νλ
νλ₯ κ³Ό ν΅κ³μμ νλ³ΈλΆμ°μΌλ‘λΆν° λͺ¨λΆμ°μ μΆμ ν λ $N$ μ΄ μλ $N-1$λ‘ λλ κ²μ κΈ°μ΅νμλμ?
\(\hat{\sigma} = \frac{1}{N - 1} \sum_{i = 1}^{N} (x_i - \mu)^2\)
μ΄ $N-1$ μ΄ λ°λ‘ βκΈ°λκ°μ μλ λΆμ°κ³Ό κ°κ² νλβ, μ¦ βνΈν₯ μλβ μΆμ μ μν 보μ μ
λλ€.
μ $N-1$μ΄μ΄μΌ νλμ§λ λμ€μ λ°λ‘ λ€λ£° κΈ°νκ° μμ κ² κ°μ΅λλ€. - μ¦, MLE μΆμ μΉκ° unbiasedλΌλ 보μ₯μ μμ΅λλ€.
- κ·Έλ¬λ, MLEμ κ΄ν΄μλ λ€μν 쑰건 νμμ λ€μν μλ ΄μ±μ 보μ₯νλ μ 리λ€μ΄ μλ €μ Έ μμ΅λλ€.
-
λ€ κ³μ° κ³Όμ μμ λ³Ό μ μλ―μ΄, exponential functionλ€μ λ 릴 μ μμ΅λλ€. Computationalνκ²λ, floating pointμ νκ³ λλ¬Έμ 0.1μ νλ₯ μ 100λ² κ³±νλ κ²μ λΆκ°λ₯νμ§λ§, $100 \log 0.1$ μ κ³μ°νλ κ²μ μ무 λ¬Έμ κ° μλ€λ μ΄μ λ μμ΅λλ€.Β β©
-
Obviously, μ¬μ€μ μ΄κ³λ―ΈλΆ (Hessian)μ ν΅ν΄ μ¦κ°μ νλ³ν νμκ° μμΌλβ¦ μ΄λΆλΆμ μ§μ κ³μ°μ ν΅ν΄ μνκ°λ₯νλ―λ‘ λμ΄κ°κ² μ΅λλ€.Β β©