Maximum A Posteriori (MAP) Estimation
📘 Maximum A Posteriori (MAP) Estimation
🔹 Definition
MAP estimation is a method for estimating model parameters by maximizing the posterior probability of the parameters given the observed data.
👉 In simple terms:
It finds parameters that are most probable after considering both data and prior knowledge.
🔹 Mathematical Formulation
Using Bayes’ theorem:
👉 MAP estimate:
🔹Simplified Optimization Form
Since is constant:
Taking log:
🔹 Interpretation
MAP combines:
- Likelihood → how well model fits data
- Prior → what we believe before seeing data
👉 Final estimate balances both.
🔹 Intuition
👉 MAP answers:
“What is the most probable parameter value given both prior knowledge and observed data?”
📌 Real-life Analogy:
- A doctor has prior knowledge about disease prevalence
- Observes symptoms (data)
- Updates belief accordingly
🔹 Difference Between MLE and MAP
| Feature | MLE | MAP |
|---|---|---|
| Uses prior | ❌ No | ✅ Yes |
| Objective | Maximize likelihood | Maximize posterior |
| Overfitting | More likely | Reduced |
| Data requirement | High | Can work with less data |
🔹 Example: Bernoulli Distribution with Prior
📌 Problem:
- Data: coin tosses
- Prior belief:
Likelihood:
Prior:
Posterior:
MAP Estimate:
Beta Distribution
The probability density function (PDF) of Beta distribution is:
Where:
-
,
👉 Why Beta?
- Conjugate prior for Bernoulli
- Simplifies computation
Goal
👉 Find the mode, i.e., the value of that maximizes .
Take Log (Simplification Step)
Instead of maximizing , maximize log:
Differentiate w.r.t.
Set Derivative = 0
Solve for
Cross-multiply:
Expand:
Rearrange:
Final Step:
📌 Special Case:
-
If (uniform prior):
👉 MAP = MLE
🔹Example: Gaussian Prior
MAP Estimation of Mean (Gaussian Likelihood + Gaussian Prior)
🔹 Problem Setup
Assume:
- Data:
-
Each
👉 Known:
-
Variance
👉 Unknown:
-
Mean
🔹 Likelihood Function
🔹 Prior Distribution (Gaussian Prior)
Assume:
👉 Prior:
🔹 Posterior Distribution
Using Bayes’ theorem:
🔹 Log-Posterior
🔹 MAP Objective
Maximize posterior
👉 Equivalent to minimizing:
where:
🔹 Differentiate w.r.t.
Expand derivative:
Step-by-step:
🔹Set derivative = 0
Divide by 2:
🔹 Simplify
🔹 Solve for μ
Final Result
🔹 Alternative Form (Important)
Let:
Then:
🔹 Interpretation
👉 MAP estimate is a weighted average:
-
Data mean
- Prior mean
🔹 Intuition
-
If more data → rely on
- If strong prior → rely on
🔹 Special Cases
📌 Case 1: No Prior (Flat Prior)
If :
👉 MAP = MLE
📌 Case 2: Strong Prior
If is large:
🔹 15. Key Insight
MAP = compromise between data and prior knowledge
📝 Summary (Quick Revision)
- Likelihood → Gaussian
- Prior → Gaussian
- Posterior → Gaussian
Final Answer:
🔹Advantages of MAP
- Incorporates prior knowledge
- Reduces overfitting
- Works well with small datasets
- More robust than MLE
🔹Disadvantages
- Requires prior selection
- Wrong prior → poor results
- More computationally complex
🔹 Applications
- Bayesian Machine Learning
- Regularized regression (Ridge, Lasso)
- Naive Bayes classifier
- Neural networks (weight regularization)
🔹 Key Concepts
📌 Prior Distribution
- Encodes initial belief
📌 Posterior Distribution
- Updated belief after data
📌 Conjugate Priors
- Makes computation easier
-
Example:
- Bernoulli ↔ Beta
- Gaussian ↔ Gaussian
📝 Summary
- MAP maximizes posterior probability
-
Combines:
- Likelihood
- Prior
- Formula:
- More robust than MLE
Comments
Post a Comment