Worked Problems
Problems in the format the course uses, with solutions written the way marks are actually awarded.
Three observations about how this material is graded, drawn from the structure of the course’s own solutions.
- Naming the principle earns the mark. Writing “by the invariance principle,” “by Jensen’s inequality,” “by the law of large numbers” is a scoring event, not decoration.
- A bare answer earns nothing. Where a question says to justify, an unjustified correct answer scores zero.
- The second-order check is separately marked. Solving is not a complete maximum likelihood derivation.
Problem 1: modelling and maximum likelihood
An emergency room records the number of patients arriving in each one-hour window. Over windows:
| Arrivals in an hour | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|---|---|---|---|---|---|---|---|
| Number of hours | 5 | 17 | 22 | 17 | 11 | 5 | 2 | 1 |
(a) A colleague proposes a Normal model. Explain why this is not appropriate and propose a better family.
(b) Modelling the counts as a random sample from , derive the maximum likelihood estimator of and verify it is a local maximum.
(c) Compute the maximum likelihood estimate from the data.
(d) Let . Give the MLE of and compute the estimate.
(e) Is the estimator in (d) unbiased for ? Justify.
Solution
(a) The counts are non-negative integers, while a Normal random variable is continuous and places probability on negative and non-integer values. A suitable family for counts of arrivals in a fixed window is the Poisson family .
(b) The Poisson pmf is , so
Setting the derivative to zero:
Second-order check:
for all , since here. So the critical point is a local maximum, and .
(c)
(d) Under a Poisson, . The map is strictly decreasing and hence invertible, so by the invariance principle
The estimate is .
(e) No. Take , which is strictly convex. By Jensen’s inequality,
and since is strictly convex and is not constant, the inequality is strict. So : positive bias, not unbiased.
Problem 2: mean squared error over a family
Sensor battery lifetimes , with the parameter of interest . Consider for .
(a) For which is unbiased for , and which familiar estimator does that give?
(b) Show that .
(c) Find the minimizing the MSE, verify it is a minimum, and explain why a biased estimator might still be preferred.
(d) Using the Cramér-Rao bound with , show that the estimator from (a) is an MVUE of .
Solution
(a) , so is unbiased exactly when , giving . This is the sample mean .
(b) By independence, . The bias is
Using :
(c) Let . Then
and , so is a minimum.
The resulting is biased low, but the small bias buys a variance reduction large enough that its MSE falls below that of . Measuring quality by MSE, trading a little bias for less variance is worthwhile.
(d) With ,
using . The Cramér-Rao lower bound is therefore . Since
the sample mean attains the bound and is an MVUE of .
Problem 3: two estimators compared
A raffle sells tickets numbered , with unknown. Each drawn ticket is returned before the next draw. Observed: . Model as a random sample from the discrete uniform on , with and .
(a) Why does returning each ticket matter for modelling the draws as a random sample?
(b) Use the method of moments to construct , show it is unbiased, and compute the estimate.
(c) The MLE is . Compute the estimate. Is unbiased? Justify without computing .
(d) A simulation at prints:
[1] 100.0 83.8
[1] 666.4 199.8being the means and variances of and over 10,000 replications. Estimate both MSEs and state which estimator you prefer.
Solution
(a) With replacement, every draw has the same distribution and the draws do not influence one another, so are independent and identically distributed. Without replacement they would still be identically distributed but not independent, since each draw changes what remains in the drum, and the random-sample model would fail.
(b) Matching the first moment: set and solve, giving . Unbiasedness:
The estimate: , so .
(c) .
is not unbiased. always, and , since all five draws can avoid ticket with positive probability. Therefore : the maximum systematically underestimates and has negative bias.
(d) Using with the simulated values:
has a substantial negative bias, yet its much smaller variance gives it the smaller MSE, so by the MSE criterion prefer . This is the bias-variance tradeoff.
Problem 4: model assumptions and the law of large numbers
A café records customers arriving in each 15-minute window over windows:
| Customers | 0 | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|---|
| Windows | 2 | 5 | 6 | 4 | 2 | 1 |
(a) Propose a family and identify its parameter. State both random-sample assumptions and describe one concrete way one could fail here.
(b) Compute . Which feature of the model distribution does it estimate, and by what result?
(c) With , let . Find such that for every .
(d) At a second location, mean(y) is 3.95 and var(y) is 9.638. Is a Poisson model appropriate?
Solution
(a) The Poisson family , with parameter , the expected number of customers arriving in a 15-minute window.
The two assumptions:
- Independence of . This could fail if customers arrive in groups spilling across neighbouring windows, or if a long queue in one window discourages arrivals in the next.
- Identically distributed. This could fail if the arrival rate changes over the afternoon, so a rush after classes end gives some windows a systematically higher rate than quiet mid-afternoon ones.
(b)
It estimates the expectation of the model distribution, here . By the law of large numbers , so for a reasonably large sample the observed average is close to the model mean.
(c) The variables are i.i.d. with finite mean and variance, since all moments of a Poisson are finite. is their sample mean, so by the law of large numbers . Using the variance identity,
so .
(d) No. Under a Poisson the mean and variance are both , so the sample mean and sample variance should be close. Here the variance is about 2.4 times the mean, far more spread than a Poisson allows. This is overdispersion, plausibly because the arrival rate varies across windows downtown, violating the identically-distributed assumption.
Problem 5: Chebyshev and sample size
A sensor measures a true CO₂ concentration , with , where the errors are independent with and . The estimator is .
(a) Explain the difference between an estimator and an estimate of , then show is unbiased.
(b) Find .
(c) Using Chebyshev’s inequality, find the smallest with .
Solution
(a) The estimator is a random variable: a rule applied to the random sample before the measurements are observed. An estimate is the realized number obtained once the actual measurements are recorded.
so is unbiased for every .
(b) is a constant, so . By independence,
(c) Applying Chebyshev with :
so , and
The smallest such is .
Problem 6: reading plots
(a) A boxplot of has a longer upper whisker, all outlier points above the box, and the median in the lower half of the box. Is the distribution symmetric, left-skewed, or right-skewed?
(b) The five-number summary of is . Using the rule, is the maximum drawn as an outlier?
(c) Two data sets have the same median and IQR, so near-identical boxplots, but one histogram shows a feature the boxplot cannot. What feature?
(d) From the shape in (a), is the sample mean of greater or less than its median?
Solution
(a) Right-skewed. The upper whisker is longer than the lower one, all the outlier points sit above the box, and the median lies closer to the lower quartile.
(b)
Since , the maximum lies beyond the upper whisker limit and is drawn as an outlier point.
(c) Bimodality. A boxplot reports only the five-number summary, so it cannot display the number of modes; a histogram with two clear peaks shows a feature the box cannot represent.
(d) Greater. The long upper tail and the high outliers pull the sample mean above the median.
Problem 7: confidence intervals
is a random sample from a distribution with mean and variance , and .
(a) Construct a conservative 80% confidence interval for in terms of , , and .
(b) Explain why it is called conservative.
(c) A 95% interval computed from data is . Which of these are correct? (i) There is a 95% chance the true mean is between 2 and 5. (ii) 95% of all samples yield an interval containing the true mean. (iii) We are 95% confident the true mean lies in .
Solution
(a) and . By Chebyshev,
Setting the bound to 0.8 gives , so
The interval is
(b) Chebyshev’s inequality gives a bound rather than an equality, so the coverage satisfies rather than . The true coverage is at least the stated level and generally higher, so the interval is wider than necessary.
(c) Only (ii) is correct.
(i) is wrong because is a fixed constant and 2 and 5 are fixed numbers, so nothing in the statement is random and no probability attaches to it.
(ii) is correct, and it is the repeated-sampling statement the confidence level actually makes.
(iii) applies “confident” to a realized numeric interval. The approved form states confidence about the procedure, using the symbolic bounds and ; once the numbers are named, the interval either contains or does not.
Problem 8: hypothesis testing
Building evaluation scores in a ward, buildings, sample mean 91.36, sample standard deviation 7.56. Test whether the mean score exceeds 80 at .
(a) State the hypotheses.
(b) Which test statistic, and what is its distribution under ?
(c) The p-value is approximately 0. State the conclusion.
(d) A 90% confidence interval for a second ward is . What does it say about at ?
Solution
(a) against . One-tailed, because the question asks whether the mean exceeds 80 rather than whether it differs from it.
(b) The population variance is unknown and estimated by , so
under , assuming the scores are a random sample from a normal distribution. Observed:
(c) Since , reject . There is very strong evidence that the mean evaluation score exceeds 80.
(d) The value 80 lies inside , so is not rejected at . A test at level and a confidence interval give the same decision: reject exactly when falls outside the interval. The correct statement is that the data do not provide sufficient evidence against , not that the mean equals 80.
Problem 9: maximum likelihood where calculus fails
.
(a) Write the likelihood function, being careful about its support.
(b) Show the usual differentiation approach fails, and find the MLE.
(c) The method of moments estimator is . Give one reason it can produce an unreasonable estimate.
Solution
(a) The density is for and 0 otherwise. So
If is smaller than any observation, that observation was impossible under the model, its density is 0, and the whole product is 0.
(b) On the region where the likelihood is non-zero, and
which is never zero for . There is no stationary point.
Argue directly instead: is strictly decreasing in , so the likelihood is maximized by making as small as the constraint allows. The constraint is , so
(c) uses only the sample mean and ignores the observed values themselves, so it can return an estimate smaller than an observation already seen. With data , , but a value of 40 was observed, so and an estimate of 23 is impossible under the model.