Comparison of Gaussian Maximum Likelihood Estimation (MLE) and Maximum A Posteriori (MAP) - Gaussian Prior
Experiment
Comparison of Gaussian Maximum Likelihood Estimation (MLE) and Maximum A Posteriori (MAP) - Gaussian Prior
🎯 Objective
-
To estimate parameters (mean) of a Gaussian distribution using:
- MLE
- MAP
- To observe the effect of prior knowledge on parameter estimation
- To compare performance under small and large datasets
Theory
🔹 Gaussian Distribution
A Gaussian (Normal) distribution is defined as:
Where:
- = mean
- = variance
🔹 MLE for Gaussian Mean
Assuming variance is known, MLE estimate of mean:
- Simple average of data
- No prior knowledge used
🔹 MAP for Gaussian Mean
Assume prior:
Then MAP estimate:
-
Weighted combination of:
- Data mean
- Prior mean
🧩 Problem Statement
Estimate the mean height of students using:
- MLE
- MAP (with prior belief about mean height)
📊 Sample Dataset
Heights (in cm):
Assume:
-
Known variance:
-
Prior: ,
🧮 Manual Calculation
Step 1: Compute Sample Mean
Step 2: MLE Estimate
Step 3: MAP Estimate
💻 Python Implementation
📈 Output
🔍 Observations
- MLE = 170 (purely data-driven)
- MAP shifts toward prior (165) → gives ~169.3
- MAP acts like a regularized estimate
Experiment Variations
1. Change Prior Strength
- Strong prior:
- Weak prior: → MAP ≈ MLE
2. Small Dataset Case
- MLE becomes unstable
- MAP remains controlled
3. Large Dataset Case
Use 100+ samples → MAP ≈ MLE
📊 Comparison Table
| Aspect | MLE | MAP |
|---|---|---|
| Uses prior | ❌ No | ✅ Yes |
| Formula | Mean of data | Weighted mean |
| Small data | Unstable | Stable |
| Interpretation | Data-only estimate | Bayesian estimate |
Results
- MLE is optimal with large data
-
MAP is useful when:
- Data is limited
- Prior knowledge exists
- MAP = Regularized MLE
- As , MAP → MLE
Comments
Post a Comment