Worked examples — Statistical estimation — MLE, method of moments
Before we start, four tiny reminders so no symbol is unearned:
- are the observed numbers (the data). is how many there are.
- is the sample mean — just "add them up, divide by how many".
- (theta with a hat) means "our guess of the true hidden number ". The hat always means estimated from data.
- is the likelihood: you multiply the density (or probability) of every data point, treating the data as fixed and as the dial you turn. It answers "how believable is this , given what I saw?" — see the parent note. Because a product of many small numbers is nasty to differentiate, we log it:
- is the log-likelihood. Since is strictly increasing, the that maximizes is the same that maximizes — but the sum is far easier to handle than the product. See Logarithms.
The scenario matrix
Every estimation problem you'll meet falls into one of these case classes. The table lists them and points at the worked example that nails each one.
| # | Case class | What makes it tricky | Example that covers it |
|---|---|---|---|
| A | Standard continuous, 1 parameter | baseline — differentiate & solve | Ex 1 (Exponential rate) |
| B | Discrete count data | pmf not density; factorials | Ex 2 (Poisson) |
| C | Two parameters at once | system of equations | Ex 3 (Normal ) |
| D | Boundary / support parameter | derivative = 0 gives NO answer | Ex 4 (Uniform ) |
| E | MoM disagrees with MLE | two recipes, two answers | Ex 5 (Uniform, MoM vs MLE) |
| F | Degenerate sample (all equal, or a zero) | estimator blows up or pins to edge | Ex 6 (Exponential with ) |
| G | MoM gives illegal (out-of-range) value | answer violates parameter constraints | Ex 7 (Binomial, unknown with fixed ) |
| H | Real-world word problem | translate English → likelihood | Ex 8 (call-centre waiting times) |
| I | Bias check / exam twist | is the "obvious" estimator honest? | Ex 9 (variance divisor vs ) |
| J | Invariance twist | asked for , not | Ex 10 (median lifetime from ) |
We now walk every cell.
Ex 1 — Case A: Exponential rate (baseline warm-up)
- Likelihood, then log-likelihood. , so . Why this step? Independence makes a product (our definition above); logging turns that product into a friendly sum.
- Differentiate, set to zero (the score equation). . Why this step? The peak of a smooth hill has zero slope; solving locates that peak.
- Solve. . Here , , so per year. Why this step? Pure algebra — isolate .
- Confirm it's a maximum. for all . Why this step? A zero-slope point could be a valley; the negative second derivative proves it's a hilltop.
Ex 2 — Case B: Poisson counts (discrete data)
- Likelihood (a product of pmf values). . Why this step? For discrete data, in our likelihood definition is just a probability; we still multiply because trials are independent.
- Log-likelihood. . Why this step? The last term is a constant in (no inside), so it will vanish when we differentiate — we keep it only for honesty. See Logarithms for .
- Differentiate & solve. . Here , , so . Why this step? Peak has zero slope; constant term dropped out as promised.
- Second-derivative check. (since ). True maximum. ✓
Ex 3 — Case C: Normal, two parameters at once
- Log-likelihood. . Why this step? Parent note's normal density, logged.
- First score: differentiate in . . Why this step? With two unknowns we hold fixed and slide to the top — a partial derivative. The multiplier is positive so it doesn't change where the zero is.
- Second score: differentiate in . . Why this step? Now slide with pinned at . Plug : deviations are , squares , so .
- Confirm it's a maximum (the multivariate check). The Hessian (matrix of second derivatives) at is diagonal: and (evaluated at , using ), with zero cross-term at the stationary point. Why this step? In two dimensions a zero-gradient point could be a saddle. A negative-definite Hessian (here: both diagonal entries negative and cross-term zero, so both eigenvalues negative) proves it's a genuine peak, not a saddle or valley.
Ex 4 — Case D: Boundary parameter, where differentiation LIES
Here the geometry, not the algebra, does the work — so study the figure carefully before reading the steps.

How to read this figure. The horizontal axis is , the candidate value of the upper bound. The vertical axis is the likelihood from our definition at the top of the page. Three things are drawn:
- The coral shaded band on the left () is the illegal region: if is smaller than the biggest data value , then that data point falls outside , its density is , and the whole product collapses to .
- The lavender curve () is , which slopes steadily downward — bigger always means smaller likelihood.
- The red dot marks the peak: it sits exactly at the left edge of the legal region, . There is no smooth "top of a hill" here; the maximum is a corner.
- The mint ticks along the bottom are the four data points ; notice the peak lands on the largest one.
- Likelihood. — but only if every ; otherwise some factor is and (the coral band in the figure). Why this step? The support () is where the tricky part hides. If is smaller than the biggest data point, that point was "impossible" under the model, killing the whole product.
- Log-likelihood, written out. For we have , so . For , and (the log of zero). Why this step? We need explicitly before we can talk about its derivative. Using (see Logarithms) turns into the clean .
- Look at the picture, not the derivative. Differentiating the legal piece gives , which is never zero for . So the score equation has no solution. Instead read the lavender curve: is strictly decreasing, so wants as small as possible — but it's forced to be at least . Why this step? Differentiation cannot find this maximum; the peak sits at the edge of the allowed region, and only the graph reveals it.
- Read off the maximizer. The largest with occurs at the smallest legal : (the red dot). Why this step? On a monotone-decreasing curve, restricted to , the top is at the left end.
Ex 5 — Case E: MoM vs MLE disagree (same uniform)
- Population mean. (centre of the interval ). Why this step? One parameter → match one moment (the first). See Law of Large Numbers for why .
- Match to sample mean. . Here , so . Why this step? Set theoretical moment equal to measured moment, solve.
- Compare. MLE said , MoM says . Why this matters? Both are "reasonable", but MoM here is more variable and can even land below on other samples — which would be logically impossible (you can't have when you already saw a ).
Ex 6 — Case F: Degenerate sample (estimator blows up)
- Compute directly. , so per unit time. Why this step? Just apply Ex 1's formula.
- Limiting behaviour. As , . Why this step? A pile of near-zero lifetimes means "things fail almost instantly" → an enormous failure rate. The model responds sensibly, but the estimate is unbounded.
- Guard against the true degenerate case . If every exactly, is undefined (). Physically that means "no time ever elapses" — the exponential model has broken down; you must reject the model, not report . Why this step? Covering the genuinely-degenerate cell of the matrix: a zero-mean sample is a modelling red flag, not a number.
Ex 7 — Case G: MoM produces an illegal (out-of-range) value
- Honest MoM (first moment). , so . Here , , giving . ✓ Why this step? One parameter → match the first moment; the mean equation respects because always.
- Flawed MoM (match the variance instead). The sample variance (dividing by ) is . Here , and , so the sample variance is . Set the model variance equal to it: , i.e. . Why this step? This is a legitimate-looking alternative moment equation — but variance ignores how close sits to the ceiling , so it can send somewhere silly.
- Solve the quadratic. . Numerically the two roots are and . Why this step? A variance equation is quadratic in , so it hands back two candidate answers — already worse than the mean equation's single clean root. The larger root predicts a mean , disagreeing with the mean-based ; you now have to choose, and MoM gives no principled way to.
- Expose the genuinely illegal case. The model variance can never exceed its maximum (attained at ). So if a sample had variance larger than , the equation would have under the square root — no real solution at all, i.e. would come out complex, hence utterly illegal. Why this matters? This is the cell where MoM earns its bad name: the "wrong" moment can hand you an ambiguous pair of roots or, when the sample variance overshoots the model ceiling, no legal value whatsoever. MLE, which respects the support and the full likelihood, can never return an out-of-range answer.
Ex 8 — Case H: Real-world word problem
- Translate English to a model. "Time between random events" → Exponential(), where = calls per minute, density . Why this step? Choosing the distribution is the real skill; the algebra is Ex 1 again. See Probability Distributions.
- Compute . minutes. Why this step? The MLE for an exponential depends on the data only through the sample mean, so this is the one number we need.
- Log-likelihood, then solve (reusing Ex 1). ; setting gives . Why this step? Identical machinery to Ex 1; we quote the result rather than re-derive it from scratch.
- (a) Rate. calls per minute. Why this step? Direct substitution into .
- (b) Mean wait. The exponential mean is , so the estimated mean wait is minutes. Why this step? By MLE invariance, the MLE of is (parent note) — here .
Ex 9 — Case I: Bias check / exam twist

How to read this figure. Imagine repeating the whole experiment thousands of times; each time you compute a variance estimate. The two coloured humps show how those estimates spread out. The coral hump is the MLE (dividing by ): its centre sits left of the dashed vertical line marking the true — on average it under-shoots. The mint hump is the unbiased estimator (dividing by ): its centre sits on the dashed line. That leftward shift of the coral hump is exactly the bias.
- The bias fact. , so the MLE underestimates on average. Why this step? Splitting into variance + bias shows dividing by shrinks the estimate (see Bias and Variance). The picture shows the coral cloud sitting left of the true .
- Fix the divisor. Multiply by : the unbiased estimator is . Why this step? — the correction exactly cancels the shrink.
- Numbers. Sum of squared deviations (from Ex 3). Unbiased: . Why this step? Same numerator, divide by instead of .
Ex 10 — Case J: Invariance twist (asked for )
- Invariance shortcut. If is the MLE of , then for any function , is the MLE of (parent note). Why this step? This saves us re-differentiating a whole new likelihood — we just plug into the median formula.
- The function. (median as a function of rate). See Logarithms for . Why this step? Identify , then apply invariance.
- Plug in. years. Why this step? Direct substitution of .
Recall One-line summary of every cell
Differentiate & solve for smooth 1-param (A), same for counts (B) and two params (C); inspect the boundary for support parameters (D); MoM & MLE can disagree (E); guard degenerate samples where estimates blow up (F); MoM can go out of range (G); word problems are model-choice + Ex 1 (H); the MLE variance is biased, fix with (I); reuse via invariance for (J).
Reveal-yourself checks: