Maximum Likelihood Estimation (MLE)
๐ Maximum Likelihood Estimation (MLE)
๐น Definition
Maximum Likelihood Estimation (MLE) is a method for estimating the parameters of a statistical model by maximizing the likelihood of the observed data.
๐ In simple terms:
MLE finds parameter values that make the observed data most probable.
๐น Basic Idea
Assume:
-
Dataset:
-
Model parameters:
๐ Likelihood function:
๐ Goal:
๐น Intuition
MLE answers the question:
“Given this data, what parameter values are most likely to have generated it?”
๐น Likelihood vs Probability
- Probability: → data varies
-
Likelihood: same expression, but viewed as a function of
๐ Key difference:
- Data is fixed
- Parameters are variable
๐นLog-Likelihood
Instead of maximizing likelihood, we maximize log-likelihood:
Why log?
- Converts products → sums
- Easier differentiation
- Numerically stable
๐น General Steps in MLE
-
Define probabilistic model
- Write likelihood function
- Take log-likelihood
- Differentiate w.r.t. parameters
- Set derivative = 0
- Solve for parameters
๐นExample 1: Bernoulli Distribution
๐ Problem:
Assume we have:
- Data:
- Each (Bernoulli trials)
Let:
- = probability of success (i.e., )
๐ Goal: Estimate using Maximum Likelihood Estimation (MLE)
Eg: Coin toss (Heads = 1, Tails = 0)
- = probability of heads
Bernoulli Distribution
For a single observation:
Likelihood Function
For independent observations:
Log-Likelihood
Take logarithm:
Differentiate w.r.t.
Set Derivative = 0
Simplify
Split the summation:
Let:
- (number of successes)
-
So:
Solve for
Cross-multiply:
Final Result
๐ This is the sample mean
Interpretation
- = proportion of 1’s in data
- i.e., fraction of successes
๐ Example:
- Data: (1, 0, 1, 1, 0)
-
Important Insight
๐ For Bernoulli distribution:
MLE estimate of probability = sample mean
Why This Makes Sense
- If many 1’s → higher probability
- If fewer 1’s → lower probability
๐ MLE naturally captures empirical frequency
Variance of Bernoulli Distribution
We know:
MLE of Variance
๐ Substitute MLE of :
Final Expression
✅ Final Result
Alternative Form
where:
๐นExample 2: Gaussian Distribution
Problem Setup
Assume:
- Data:
-
Each
๐ Unknown parameters:
-
Mean
-
Variance
๐ Goal: Estimate and using MLE
Gaussian Probability Density Function
For one data point:
Likelihood Function
For independent data:
Log-Likelihood
Take logarithm:
MLE for Mean ฮผ
Step 1: Differentiate w.r.t. ฮผStep 2: Set derivative = 0
Step 3: Solve
Result:
MLE for Variance
Step 1: Differentiate w.r.t.
Step 2: Set derivative = 0
Step 3: Solve
Multiply both sides:
Result:
Final MLE Estimates
๐ These are intuitive:
- Mean → average
- Variance → spread
๐น Properties of MLE
✅ 1. Consistency
- Estimates approach true value as data increases
✅ 2. Efficiency
- Has minimum variance (under conditions)
✅ 3. Asymptotic Normality
- Distribution becomes normal for large samples
❌ 4. Bias
- Can be biased for small samples
๐น Advantages
- Simple and widely applicable
- Works for many distributions
- Strong theoretical foundation
๐น Disadvantages
- Sensitive to outliers
- Requires correct model assumption
- Can overfit with small data
๐น Applications of MLE
- Linear Regression
- Logistic Regression
- Naive Bayes
- Hidden Markov Models
- Neural Networks (via loss functions)
๐น Connection to Loss Functions
MLE often leads to common loss functions:
| Model | Loss Function |
|---|---|
| Gaussian | Mean Squared Error |
| Bernoulli | Cross-Entropy |
| Multinomial | Log-loss |
๐ Summary
- MLE finds parameters that maximize likelihood of data
-
Uses:
- Likelihood function
- Log-likelihood
-
Common results:
- Mean = average
- Variance = spread
- Widely used in ML models
Comments
Post a Comment