1.3.17 · D5Probability & Statistics

Question bank — Maximum a posteriori estimation (MAP)

1,897 words9 min readBack to topic

Quick vocabulary refresher so nothing below is a mystery:


True or false — justify

MAP always gives a different answer than MLE.
False. With a uniform (flat) prior the log-prior is constant, so it drops out of the argmax and MAP collapses exactly onto MLE.
As the sample size (number of observations) grows, the MAP estimate drifts further from the MLE.
False — the opposite. The likelihood grows with every data point while the prior stays fixed, so the prior's relative weight shrinks and MAP MLE as .
MAP returns the mean of the posterior distribution.
False. MAP returns the mode (the peak). Mean and mode agree only for symmetric posteriors like the Gaussian; for skewed ones like Beta or Gamma they differ.
The MAP estimate is always a valid probability (between 0 and 1) when estimating a coin bias.
True for the parameter's own range, because the prior support forces ; but that is guaranteed by the model's domain, not by MAP itself.
Multiplying by the prior can only shrink the estimate toward zero.
False. The prior pulls the estimate toward the prior's high-density region, which may be above or below the MLE. A Beta(3,2) prior (mean 0.6) can pull a low MLE up.
The evidence term must be computed to find the MAP estimate.
False. The evidence is constant in , so it never affects the location of the maximum and is dropped. You need it only for the normalized posterior, not for the argmax.
L2 regularization and MAP with a Gaussian prior are two names for the same optimization.
True. Minimizing is exactly maximizing the log-posterior with . See Regularization in ML and Ridge Regression.
A stronger prior (smaller prior variance ) means the data has more influence.
False. Small prior variance = high prior precision = high confidence, so the data has less pull and the estimate stays closer to the prior mean.
MAP requires the prior and likelihood to be conjugate.
False. Conjugate Priors make the posterior a clean closed form, but MAP only needs you to maximize log-likelihood + log-prior — that can be done numerically for any prior.

Spot the error

"Since the posterior is proportional to likelihood times prior, MAP = MLE times prior mode."
Wrong. You multiply the functions and then find the argmax of the product; you cannot multiply the two separate estimates together.
"I'll drop because it's a constant, just like I dropped ."
Error. The evidence is constant in , but depends on — dropping it deletes the prior and turns MAP back into MLE.
"Beta(1,1) is an informative prior favoring low values."
Wrong. Beta(1,1) is the uniform prior on — it is flat and uninformative, so MAP under it equals MLE.
"The mode of a Beta is ."
That is the mean. The mode is (for ); confusing them is the classic mode/mean slip.
"Taking the log changes where the maximum is, so log-posterior MAP ≠ posterior MAP."
Wrong. is monotonically increasing, so it preserves the location of the argmax. It only makes products into sums for easier differentiation.
"A larger in ridge regression corresponds to a wider (weaker) Gaussian prior."
Reversed. From the Gaussian prior the penalty is , so matching it to forces ; larger therefore means smaller — a narrower, stronger prior that shrinks weights harder.

Why questions

Why does MAP prevent Overfitting when data is scarce?
With few data points the likelihood is flat and noisy; the prior supplies extra structure that anchors the estimate to plausible values instead of chasing sampling noise.
Why do we add the log-prior instead of multiplying the prior in the objective?
Because we took the log of a product (likelihood × prior), and turns the product into a sum that is far easier to differentiate.
Why is L1 / Lasso regularization the MAP estimate under a Laplace prior, not a Gaussian one?
The Laplace density has a shape (where is its scale parameter, controlling spread), so its negative log is — exactly the L1 penalty, whereas Gaussian gives the squared L2 penalty.
Why does the Gaussian-mean example give a weighted average of data mean and prior mean?
The log-posterior is a sum of two quadratics; setting its derivative to zero linearly balances each term by its precision (inverse variance), which literally is a weighted average of (weight = data precision ) and (weight = prior precision ).
Why can't we always just report the posterior mean instead of the MAP mode?
The mean requires integrating (normalizing) the whole posterior, which is often intractable; the mode only needs an argmax, which optimization handles cheaply.
Why does a flat prior make MAP "objective-free"?
A flat prior treats every parameter value as equally plausible a priori, so it injects no preference — the estimate is driven purely by the data, i.e. MLE.

Edge cases

What is MAP when the prior puts zero probability on a region of ?
MAP can never land there — the log-prior is , so that region is forbidden regardless of how strongly the data supports it.
What happens to the Beta-coin MAP if you observe zero flips ()?
The likelihood is constant, so the posterior equals the prior and MAP returns the prior mode — pure belief, no evidence. Caveat: if the prior is the uniform Beta(1,1), that prior is flat, so its mode is not unique (every is a peak) and MAP is undefined here.
For a Beta posterior with exactly one of or , where is the mode?
The density blows up at one endpoint (0 if , 1 if ), so the mode sits at that boundary, and the smooth "set derivative to zero" formula no longer applies.
For a Beta posterior with both and , where is the mode?
The density blows up at both endpoints, giving two equal boundary modes at 0 and 1 — a genuine tie, and MAP cannot pick between them.
What is the MAP estimate under an improper (unnormalizable) flat prior over the whole real line?
It still works as long as the posterior itself is proper — the constant prior drops out and MAP equals MLE, even though isn't a real distribution.
If the posterior is bimodal (two equal peaks), what does MAP report?
MAP returns just one peak (or is ambiguous between them), which is misleading — a single point badly summarizes a two-humped belief.
As prior variance in the Gaussian-mean example, what does approach?
It approaches , the MLE, because an infinitely wide prior is effectively flat and contributes nothing to the optimization.
What does MAP give if likelihood and prior peak at opposite ends of the range?
A compromise located between them, pulled toward whichever term is sharper (higher curvature / more confident), not simply the midpoint.
Recall One-line summary to lock in

MAP = argmax of (log-likelihood + log-prior) = the mode of the posterior; it becomes MLE with a flat prior and becomes L2/L1 regularization with a Gaussian/Laplace prior.