Maximum likelihood: bias and the link to least squares
10 questions on bias in maximum likelihood, the variance correction, overfitting and why least squares comes from Gaussian noise.
- 10 questions
- Stopwatch
- Instant feedback
Sample questions
Play now ↑Answers stay hidden. Start the quiz to play them.
Sample 1
A Gaussian is fitted by maximum likelihood to just two observations. By what factor is the fitted variance too small on average?
- It is half the true value
- It is a quarter of the true value
- It isn't too small at all
Sample 2
Once the best curve has been found, how can the noise level be estimated?
- From the average squared gap between the fitted curve and the targets
- It must be guessed in advance and cannot be learned
- From the largest coefficient of the curve
How it works
- One question per screen. An answer is final once sent.
- You see right away whether you were right, with a short explanation.
- The stopwatch runs: on equal scores, the faster player ranks first.
- Only your best attempt counts, so replaying is never risky.
About this quiz
Maximum likelihood is the workhorse of statistical estimation and the basis of how most machine learning models are trained. It has a very attractive idea at its heart: pick the parameters that make the data you saw most probable. But it is not perfect, and one of its flaws can be shown with the simplest example imaginable, fitting a single bell curve to a handful of numbers. The fitted spread comes out too small, not by accident, but systematically. Seeing why gives you an early warning about overfitting, which becomes far more serious in large models.
This quiz starts with that flaw. When you estimate the centre of a Gaussian from data, the estimate is right on average. When you estimate the spread, it is not, and the size of the error depends on how many observations you have. You will work through where the bias comes from, how large it is for small samples, why it fades as data accumulates, and what the simple correction is. You will also see why the same problem is much harder to deal with in networks with millions of parameters.
The second half connects maximum likelihood to something most people met first as a drawing exercise: fitting a curve by minimising squared errors. The connection is that if you assume the noise on the target values is Gaussian, then the curve that maximises the likelihood is exactly the one with the smallest sum of squared errors. The quiz asks what that assumption means, what else you can estimate once the curve is fixed, and what the fitted model can tell you beyond a single predicted value, namely how uncertain that prediction is.
Mistakes to watch for include assuming that an estimator that works on average works well for every sample size, mixing up « unbiased » with « accurate », and believing that least squares is simply a convenient trick with no deeper justification. The quiz also corrects the idea that a larger model is a stronger one: more parameters make the bias of maximum likelihood bigger, not smaller. Knowing about this bias also changes how you read published numbers: a spread estimated from a few measurements deserves some suspicion, and a model that performs wonderfully on the very data it was fitted to has told you very little about how it will behave on new data.
The quiz suits students in statistics and machine learning, and practitioners who want to know why textbooks divide by one less than the number of observations. No calculus is needed. There are 10 questions with explanations, and it takes about four minutes.
Questions and answers
›How long does the quiz take?
About 3 to 4 minutes for 10 questions, at roughly 20 seconds each. An explanation appears after every answer.
›Do I need to know how to derive the estimators?
No. The questions are about what the results mean, not about proving them. You are asked to recognise which estimate is biased, in which direction, and why a particular error function appears in regression.
›What does it mean for an estimator to be biased?
An estimator is biased if, averaged over many data sets of the same size, it does not equal the true value. It is a systematic error rather than random noise. Bias does not mean that the estimate is useless for one data set, only that it leans in a consistent direction.
›Why does maximum likelihood underestimate the variance?
The spread is measured around the average of the data, and that average has already been fitted to the same points. It sits closer to them than the true centre does, so distances come out smaller. With only a couple of observations the effect is large, and it fades as the data set grows.
›What is the usual correction?
Dividing by one less than the number of observations, instead of the number itself, gives an unbiased estimate of the variance for a Gaussian. Statistical software often does this by default for sample variance, which is why the two possible formulas sometimes give slightly different answers.
›How is this related to overfitting?
Both come from tuning a model to the particular data at hand. A model with many parameters can adjust itself to the quirks of the sample, so its performance on the sample overstates how well it will do elsewhere. For complex models, the problem is far greater than for a single Gaussian, and a simple correction is not available. For people who train models, the practical message is that no fitted value is free of the sample it came from. This is why careful practice keeps data aside for checking, uses penalties that discourage extreme parameter values, and treats a perfect fit to the training data as a warning rather than as a success.
›Why is least squares linked to the Gaussian?
If you assume that each observed target equals the true curve plus Gaussian noise, the likelihood of the data is largest when the squared gaps between the curve and the targets are as small as possible. Least squares is therefore not arbitrary: it is the maximum-likelihood answer under that particular noise assumption.
›What is a predictive distribution?
It is the probability distribution that a fitted model assigns to a new target value. Instead of one number, it gives a centre and a spread, so you can say how confident the prediction is. In the simple regression case, the centre is the fitted curve and the spread is the estimated noise.