Exercises — Statistical estimation — MLE, method of moments
Reminder of the two recipes, in plain words:
- Method of Moments (MoM): the true average of (call it , the number you'd get if you could sample forever) is a formula containing the unknown. Your measured average is your best real-world stand-in for it. Set formula = measured, solve. (Law of Large Numbers promises this is legitimate.)
- MLE: write the probability of exactly your data as a knob-turning function of the unknown; turn the knob to make that probability as big as possible.
Notation we will keep using:
- = the actual numbers you observed. = how many.
- = the sample mean (ordinary average).
- = "theta-hat" = our guess for the unknown .
- = expected value = the long-run average of .
Level 1 — Recognition
Exercise 1.1
A machine produces items; each is defective (1) or fine (0). You see items, defective. Name the distribution, its unknown parameter, and write the MLE without deriving (recall it).
Recall Solution
Each item is a yes/no trial → Bernoulli(), unknown = probability of defect. The MLE of a Bernoulli probability is the sample proportion: Here is the number of successes (defects).
Exercise 1.2
Waiting times between bus arrivals are modelled as Exponential with rate . You record times with mean minutes. State the MLE of and of the mean waiting time.
Recall Solution
For the Exponential, both MoM and MLE give The mean of an Exponential is , so by the invariance property (the MLE of a function is that function of the MLE) the estimated mean is minutes.
Level 2 — Application
Exercise 2.1
Data are assumed Exponential(). Find the MLE .
Recall Solution
Step 1 — average the data. Why? The MLE of an Exponential depends only on . Step 2 — apply the formula.
Exercise 2.2
Data are assumed Normal . Find the MLE of both parameters.
Recall Solution
Step 1 — the mean. For a Normal, . Step 2 — the variance. The MLE of divides by (not ): Deviations from : . Squares: , sum .
Exercise 2.3
The Poisson distribution counts rare events; its pmf is Here is both the mean and the variance. Derive the MLE of from data , then apply it to .
Recall Solution
Step 1 — likelihood (multiply the pmf over all data; independence): Step 2 — log-likelihood. Why log? Because turns the ugly product/power into a sum, and (being strictly increasing, see Logarithms) it has the same maximizer: The last term has no , so it's a constant for the maximization. Step 3 — differentiate, set to zero. Why? The peak of a smooth curve has zero slope: Step 4 — confirm it's a maximum (second derivative negative): Apply: , so .
Level 3 — Analysis
Exercise 3.1
For the Uniform distribution (every value between and equally likely, density on ), find the MLE of from data . Then compare with the method-of-moments estimate. Data: .
Recall Solution
MLE — why differentiation fails here. The likelihood is The indicator is a switch: it is when the condition holds, otherwise. If any data point exceeds , that factor is , killing . So for , and for . Look at Figure 1: the red curve jumps up at and then decreases ( shrinks as grows). The highest allowed point is the leftmost allowed , exactly at the maximum data value: Setting gives , which has no solution — the maximum sits at a boundary, found by inspection, not calculus.

MoM. The mean of is the midpoint . Set : Analysis. Both are legitimate, but MoM gave while we saw a value — consistent. The MLE () can never be smaller than the largest observation (good), yet it is biased low (it can never exceed the true ). MoM here is unbiased but can be smaller than a data point in unlucky samples, which is absurd for a Uniform's upper limit. This is the classic "MoM gives out-of-range values" warning.
Exercise 3.2
Prove that the MLE for a Normal is biased, and state the fix.
Recall Solution
Goal: compute and compare to . A known identity (the "sum-of-squared-deviations" fact) gives Why and not ? Because subtracting the estimated mean (rather than the true mean) removes one "degree of freedom" — the deviations are forced to sum to zero, so one of them is not free. Dividing by : So the MLE underestimates on average — its bias is . The unbiased fix divides by : See Bias and Variance: the MLE trades a little bias for maximizing likelihood.
Level 4 — Synthesis
Exercise 4.1
A Geometric distribution counts trials until the first success: for , with mean . (a) Find the MLE of . (b) Find the MoM estimate. (c) Do they agree? Apply to data .
Recall Solution
(a) MLE. Log-likelihood (using to split the product; see Logarithms): Differentiate and set to zero: Multiply through by : Second derivative (both terms negative since ), confirming a maximum. (b) MoM. Mean , set . (c) They agree: . As with the Exponential, when the mean is a clean function of the single parameter, MoM and MLE coincide. Apply: , so .
Exercise 4.2
Suppose estimates the mean of a distribution with true variance , sample size , and true mean . Its sampling variance is . Compute the MSE of , using the decomposition .
Recall Solution
Bias: is unbiased for the mean, , so bias . Variance: . MSE: The true mean was a red herring — for an unbiased estimator the MSE is just the variance, independent of where the true value sits.
Level 5 — Mastery
Exercise 5.1
The shifted Exponential has density for (and below ); shifts the whole curve rightward. Find the MLE of . Data: .
Recall Solution
Likelihood. Every data point must satisfy , otherwise its density is : Analysis of the shape (Figure 2). For fixed data, increases in — bigger is better. But we're capped: cannot exceed the smallest data point, or some indicator flips to . So push as high as allowed: Again calculus alone fails (, no interior root); the maximum is at the boundary .

Exercise 5.2
For the Poisson MLE (Exercise 2.3), use the invariance property to find the MLE of the probability of zero events, . Then apply to the data (where ).
Recall Solution
Invariance says: if is the MLE of , then for any function , the MLE of is — you just plug the hat in. Here : No new maximization needed — that is the whole point of invariance. (Contrast this with Bayesian Estimation, where you'd instead average over a posterior distribution of rather than plug in a single best value.)
Exercise 5.3 — capstone
You have observations from with both unknown. (a) Which estimator of does MLE give, and is it consistent despite being biased? (b) Briefly connect to the Cramér-Rao Lower Bound.
Recall Solution
(a) MLE gives , biased by factor . But as , , so the bias vanishes and its variance shrinks to ; therefore it is consistent (). Bias at finite does not prevent consistency in the limit. (b) The Cramér–Rao Lower Bound is a floor on the variance any unbiased estimator can achieve. MLEs are asymptotically efficient — for large they attain that floor. So MLE isn't perfect at small (it can be biased), but it becomes the best-possible unbiased estimator as data accumulates. That is precisely why we tolerate the small-sample bias.
Recall Quick self-check (cloze)
The MLE of a Uniform is ==, found by inspection/boundary, not differentiation==. The MLE of a shifted-Exponential's shift is ====. The invariance property lets you estimate by ==== with no new maximization. For an unbiased estimator, equals the variance because the bias term is zero.