Skip to content
tezvyn:
Menu

MLE versus MAP estimation and the role of priors

Source: interviewHardHow cards are made

Summary

Bayesian versus frequentist parameter estimation.

Key points

MLE maximizes likelihood alone; MAP maximizes likelihood times a prior, acting as regularization that shrinks toward prior beliefs; with abundant data they converge.

What's really being asked

This probes your fluency with the frequentist-versus-Bayesian framing of estimation and your ability to see regularization as a prior. It separates people who memorized formulas from those who understand how data volume shifts the balance.

The full answer

Maximum Likelihood Estimation chooses the parameter theta that maximizes the likelihood P(data given theta); it asks which parameter makes the observed data most probable and uses no prior belief. Maximum A Posteriori instead maximizes the posterior, which by Bayes' rule is proportional to P(data given theta) times the prior P(theta). The prior encodes belief before seeing data. Because MAP multiplies the likelihood by the prior, the prior acts as regularization, shrinking estimates toward its high-density region. A Gaussian prior on parameters corresponds to L2 regularization; a Laplace prior corresponds to L1.

The mistakes people make

Saying MAP is always more accurate. Forgetting that with a uniform prior MAP reduces exactly to MLE. Claiming the prior never matters, when in fact it can dominate under scarce data. Confusing MAP, a point estimate, with full Bayesian inference that returns a posterior distribution.

What usually comes next

Show that a Gaussian prior gives ridge regression. What happens to both estimates as sample size goes to infinity. How does MAP differ from computing the posterior mean.

A concrete example

Estimate a coin's bias from three flips, all heads. MLE gives probability 1.0 of heads, an overconfident estimate from tiny data. With a Beta(2,2) prior favoring fairness, MAP pulls the estimate toward 0.5, yielding something like 0.6, which is far more reasonable. After a thousand flips the data dominates and both methods nearly agree, showing the prior matters most when evidence is thin.

Interview question

Under what condition does MAP estimation give essentially the same result as MLE?

  • a.When the prior is uniform or the dataset is very largeCorrect
  • b.When the dataset is very small
  • c.When the likelihood is non-convex
  • d.When the prior is very strong and informative
Why?

A uniform prior makes the posterior proportional to the likelihood, and with large data the likelihood overwhelms any prior, so MAP converges to MLE. A strong prior on small data does the opposite.

Just read this? Test yourself on what you have been reading.

Read the original → en.wikipedia.org

Put your scrolling time to good use

Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.

See open roles