What is the difference between MLE and MAP estimation, and how can you show that L2-regularised linear regression is MAP with a Gaussian prior?

Probability and statistics, Estimation
Level L3 Intermediate. Length Medium. Nature Th+Mat Both.

What's being asked

Whether you can connect regularisation to Bayesian priors, instead of treating it as a trick.

Key idea

MLE (maximum likelihood estimation) maximises p(D∣θ), the probability of the data D given the parameters θ. MAP (maximum a posteriori) estimation maximises p(θ∣D)∝p(D∣θ) p(θ), where p(θ) is the prior. Taking negative logs, a prior θ∼N(0,τ2I) with variance τ2 adds 12τ2∥θ∥2 to the loss.

Steps

  1. Define MLE: θ^MLE=arg⁡max⁡θlog⁡p(D∣θ). The log turns a product over data points into a sum, which is easier to optimise.
  2. Define MAP with Bayes’ rule. Drop the evidence p(D), because it does not depend on θ.
  3. For linear regression with weights w, training pairs (xi,yi) and Gaussian noise of variance σ2, write −log⁡p(D∣w)=12σ2∑i(yi−w⊤xi)2+const.
  4. Add −log⁡p(w)=12τ2∥w∥2+const. Multiplying through by 2σ2 gives ridge regression with λ=σ2/τ2, where λ is the penalty strength.
  5. Note that a Laplace prior gives L1 (lasso) in the same way. MAP is still a point estimate, not a full posterior.

Common mistakes

How long your answer should be

2–3 minutes: the definitions, then a three-line derivation.

Read this

Previous in Probability and statistics: You pick door 1 out of three, one of which hides a car. The host, who knows where the car is, always opens a different door that has a goat and offers you a switch. He opens door 3. Using Bayes' rule, what is the probability that the car is behind door 2, and why is the host's knowledge important?
Next in Probability and statistics: Is KL divergence a distance, and why is minimising cross-entropy the same as maximum likelihood?