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

DataFamilyML estimatesRead-off
, , ()bulk of samples inside
, , and under the fit
same 9 heightsplug-in —

✍️ Practice

⚠️ 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