Contents
Maximum Likelihood vs Maximum a Posteriori/Chapter 09 of 09
09Summary
- Likelihood: L(\theta)=p(D\mid\theta)=\prod_ip(x_i\mid\theta), a function of \theta, not a distribution over it. MLE: \hat\theta=\arg\max_\theta\sum_i\log p(x_i\mid\theta); coin h/n; Gaussian \bar x and \frac1n\sum_i(x_i-\bar x)^2 (biased by \frac{n-1}{n}).
- Losses: least squares = MLE with Gaussian noise; cross-entropy = MLE for class labels; MLE minimizes \mathrm{KL}(p_{\mathrm{data}}\|p_\theta).
- Weakness of MLE: it trusts the data completely and overfits small data (3 heads in 3: \hat\theta=1; unseen words get probability 0).
- Bayes’ theorem: p(\theta\mid D)=p(D\mid\theta)\,p(\theta)/p(D), posterior \propto likelihood \times prior. Rare disease, 1/1000, 5\% false positives: P(S\mid+)\approx2\%.
- MAP: \hat\theta=\arg\max_\theta\big[\sum_i\log p(x_i\mid\theta)+\log p(\theta)\big]. Beta prior: (h+\alpha-1)/(n+\alpha+\beta-2), a prior is imaginary data. Posterior mean with a flat prior: (h+1)/(n+2) (Laplace).
- Seesaw: Gaussian mean with prior \mathcal N(\mu_0,\tau^2): \hat\theta=(m\mu_0+n\bar x)/(m+n), m=\sigma^2/\tau^2. One five-star review \to4.09; 2{,}000 reviews at 4.7\to4.70.
- Regularization: Gaussian prior \to ridge, \lambda=\sigma^2/\tau^2; Laplace prior \to lasso, \lambda=2\sigma^2/b; \mathrm{Beta}(2,2) or Dirichlet prior \to add-one smoothing.
- When they agree: flat prior, or n\to\infty. Limits of MAP: no uncertainty, untypical modes, not invariant to reparameterization.