Maximum Likelihood Estimation
Context: FIT2086_MOC · the unit’s universal fitting engine — turns a [[Parametric Probability Distributions|family ]] plus a sample into a number · quality of that is judged in Estimator Quality (Bias, Variance, MSE), its variability in Sampling Distribution of an Estimator · Fisher, 1920s
Quick Revision
- 🎯 Objective: pick the that assigns the greatest probability to the data observed ➔ .
- 📦 Core Components: likelihood ➔ NLL ➔ ➔ .
- ⚡ Key Constraint: is the negative log-likelihood, so you minimise it — flip a sign and every derivation lands on a maximum of the wrong quantity.
📝 How It Works
1. The three tasks of inference
- Point estimation ➔ learn one best-fitting parameter value from the data — this note.
- Interval estimation ➔ quantify accuracy/confidence in that fit (W4 CIs).
- Hypothesis testing ➔ decide whether a stated claim about the data-generating process is plausible (W5).
2. Why not just minimise squared error
- The heuristic ➔ choose close to all points under squared error: , so — read as the that minimises , and the hat as “estimator of”.
- It gives the sample mean ➔ — the sample mean is the closest point to the sample in a squared sense.
- ⚡ Key Constraint: no handle on ➔ squared error scores only the centre; a spread parameter has no obvious goodness-of-fit under it, so a general criterion is needed.
3. The likelihood criterion
- Goodness-of-fit = probability assigned to the data ➔ score a candidate by ; larger means the observed data is more likely under that model. Read as the likelihood function — a function of with fixed.
- Independence factorises it ➔ for the iid models of this unit.
- Work with the NLL ➔ products of small probabilities are analytically and numerically horrible; turns them into sums, and because is strictly increasing.
- Notation ➔ ; is generic, and for Bernoulli the specific parameter also happens to be called .
- Status ➔ originally a heuristic, later shown to have strong properties — notably statistical consistency for most models.
4. Product and log identities (the whole algebra of step 2)
- Constants ➔ · .
- Exponents collapse to sums ➔ · .
- Constant factors pull out ➔ .
- Then log ➔ · · · terms free of are constants whose derivative vanishes.
5. Using the fit: the plug-in distribution
- Plug-in ➔ substitute the estimates back into the family, , and treat it as the population.
- What it buys ➔ probability statements about the population: for the height data, .
- Accuracy inherits ➔ the better , the more trustworthy every downstream probability — which is why estimator quality gets its own note.
- Checking the fit ➔ score the plug-in model on held-out data, comparing predicted probabilities against empirical proportions and ranking models by out-of-sample NLL ➔ Plug-in Prediction and Held-Out Evaluation.
🧮 Proof Blueprint
Theorem (ML recipe). For iid , solves . Strategy: factorise ➔ take ➔ differentiate ➔ set to zero ➔ rearrange.
Derivation — Gaussian , :
Q.E.D. ➔ for the Gaussian the ML estimators are the sample mean and the sample standard deviation (with divisor ). Multiply through by to clear denominators; is substituted before differentiating in , which removes from the equation.
Derivation — Poisson , :
Q.E.D. ➔ the Poisson rate’s MLE is again the sample mean — but this coincidence is not a rule, as the practice derivations below show.
Derivation — Bernoulli , , (Studio 3):
Q.E.D. ➔ the ML success probability is the fraction of successes, i.e. the sample mean of the trials. The exponents collapse because counts the successes and the failures; the derivative’s supplies the sign flip.
📊 Worked Numbers
| Data | Family | ML estimates | Read-off |
|---|---|---|---|
| , | , () | bulk of samples inside | |
| , | , and under the fit | ||
| same 9 heights | plug-in | — |
✍️ Practice
Practice 1: with . Derive .
Reference solution
- Key move: ➔ the estimator is the reciprocal of the sample mean, not the sample mean.
Practice 2: pollination rates have on , . Derive .
Reference solution
- Key move: , then multiply by to clear denominators; because on .
Practice 3: seed germination with on (else ), . Derive and contrast with Practice 2.
Reference solution
- Key move: the exponent here is (linear in the parameter) versus (a reciprocal in the parameter) ➔ same data, reciprocal estimators: against .
⚠️ Common Mistakes
- 💡 Maximising the NLL ➔ carries the minus sign already; maximise or minimise , never maximise .
- 💡 Dropping the -free terms too early — or too late ➔ (Poisson) and (Gaussian) vanish on differentiation, but they belong in if the question asks for the NLL value.
- 💡 Differentiating in before plugging in ➔ leaves two unknowns coupled; substitute first, then the equation solves in one line.
- 💡 Assuming the MLE is always the sample mean ➔ true for Gaussian and Poisson , false for () and for the power families above.
- 💡 Forgetting the ML variance divides by ➔ ; the version is a different, unbiased estimator — see Estimator Quality (Bias, Variance, MSE).
- 💡 Taking a boundary estimate at face value ➔ gives and gives , ruling out the unseen outcome entirely in every future prediction; ML is overconfident on small samples and at this happens always.
🧠 Active Recall
Why is minimum squared error abandoned in favour of maximum likelihood, given both return for the Gaussian mean?
Answer
- Short answer: SSE only scores closeness of a centre — it offers no goodness-of-fit measure for a spread parameter like , whereas ML scores the whole model and so estimates every parameter of any family.
- Why: Generality ➔ ML’s criterion is defined for any of any distribution, giving simultaneous equations ; the agreement on is a coincidence of the Gaussian’s quadratic exponent, not equivalence of methods.
You toss a coin twice and see two heads. What does ML report for , why is that a problem, and what does it say about ML generally?
Answer
- Short answer: ➔ the plug-in model assigns , declaring a tail impossible on all future tosses. No one would accept that conclusion from two tosses.
- Why: ML optimises fit to the observed sample, with no allowance for what was not observed ➔ the boundary estimates are attained whenever , which is likely for small and certain at ; the estimator is therefore overconfident, and the fix is either more data or a prior that keeps off the boundary.
- Hint: the same over-confidence appears continuously as understating spread — see Plug-in Prediction and Held-Out Evaluation, where the too-narrow density mispredicts held-out tail probabilities.
Why take logs at all, and why does it not change the answer?
Answer
- Short answer: turns into — differentiable term by term and numerically stable — and because is strictly increasing, .
- Why: Monotone reparameterisation of the objective ➔ a strictly increasing transform preserves the location of the extremum while changing its value; without it the product of densities underflows and the chain rule compounds across factors.