From Optimization to Probabilistic Modeling
π§ From Optimization to Probability
So far, we wrote regression as an optimization problem:
But we can reinterpret this using probabilistic modeling.
π Maximum Likelihood Estimation (MLE)
Assume a standard linear regression model:
where:
πΉ Likelihood
πΉ MLE Objective
Maximizing likelihood is equivalent to:
π This is just ordinary least squares
π Maximum A Posteriori (MAP)
Instead of only likelihood, MAP uses:
πΉ MAP Objective
Maximize posterior:
Take negative log:
π― Key Insight
π Regularization term = log prior
π·Ridge Regression as MAP (Gaussian Prior)
πΉ Assume Prior on Weights
πΉ Prior Probability
πΉ Negative Log Prior
πΉ MAP Objective
π― Conclusion
π Ridge regression = MAP with Gaussian prior
π§ Interpretation
- Gaussian prior prefers small weights
- Penalizes large deviations smoothly
πΆLASSO as MAP (Laplace Prior)
πΉ Assume Prior
πΉ Prior Probability
πΉ Negative Log Prior
πΉ MAP Objective
π― Conclusion
π LASSO = MAP with Laplace prior
π§ Interpretation
- Laplace prior is peaked at zero
- Encourages exact zeros
- Leads to sparsity
⚖️Why Priors Matter (Key Insight)
π· Gaussian Prior (Ridge)
- Smooth bell-shaped curve
- Penalizes large weights gradually
π Result:
- Shrinkage, but no zeros
πΆ Laplace Prior (LASSO)
- Sharp peak at zero
- Heavy tails
π Result:
- Many weights exactly zero
πVisual Intuition (Conceptual)
| Prior | Shape | Effect |
|---|---|---|
| Gaussian | Smooth | Small weights |
| Laplace | Sharp at zero | Sparse weights |
π Connecting Ξ» to Probability
π Interpretation:
- Noise variance vs prior variance
- Balances data vs prior belief
π§ Big Picture Interpretation
πΉ Without Regularization (MLE)
- Only data matters
- Risk of overfitting
πΉ With Regularization (MAP)
- Data + prior belief
- More robust model
π Teaching Analogy
MLE:
“Trust only the data”
MAP:
“Trust data, but also apply prior knowledge”
Ridge:
“Weights should be small”
LASSO:
“Most weights should be zero”
π― Key Takeaways
- Regularization = adding prior knowledge
- Ridge = Gaussian prior → smooth shrinkage
- LASSO = Laplace prior → sparsity
- MAP = unifies optimization and probability

Comments
Post a Comment