Show that ridge regression is the MAP (maximum a posteriori) estimate under a Gaussian prior, and lasso under a Laplace prior, when the noise is Gaussian. If the noise variance is and the prior is with , what ridge does this give?
Supervised learning, Ridge, lasso and Bayesian priors
Level L3 Intermediate. Length Medium. Nature Mat Mathematical.
What's being asked
Whether you can write the log posterior and read off the penalty and its strength from the prior.
Key idea
. A Gaussian prior gives an L2 penalty with . A Laplace prior gives an L1 penalty.
Steps
- Likelihood: , so .
- Gaussian prior : .
- Maximising the posterior equals minimising the sum. Multiply by : , which is ridge with .
- Numbers: . A tighter prior (smaller ) means a larger and more shrinkage.
- Laplace prior : . Multiplying by gives lasso with .
- Note: the Laplace density is sharply peaked at 0, which is why the MAP estimate can be exactly zero. The posterior mean under this prior is not sparse.
Common mistakes
- Saying the lasso solution is the posterior mean. It is the mode (MAP).
- Getting upside down: , not .
- Forgetting that these hold only with a fixed . Changing the noise level changes the effective penalty.
How long your answer should be
Half a page; 5 minutes.
Last checked on 4 December 2026.
Read this
Previous in Supervised learning: The elastic net minimises . How do you show that it is a lasso problem on augmented data, and what does this imply for the number of variables it can select and for correlated features?
Next in Supervised learning: Take an orthonormal design () with noise variance . For one coefficient with true value , find the mean squared error of the ridge estimate as a function of . Show that some always beats OLS, find the best , and evaluate it for , . Why is this not a free lunch?