Every estimator so far was found by analogy: to estimate a population mean, take a sample mean. That runs out as soon as the parameter is not a simple feature of the distribution, and it gives no guidance at all when two parameters have to be estimated together. This lesson gives the general recipe, which Ronald Fisher developed between 1912 and 1922 and which underlies almost every estimate produced by statistical software today.
The likelihood function
Start with a model that says how probable the data is, given a parameter. For discrete data, is an ordinary probability; for continuous data it is a density. Now hold the data fixed at what was actually observed and read the expression as a function of . That function is the likelihood,
and for independent observations it factorises into .
The idea is then blunt: prefer the value of that makes the observed data as probable as it can be. The maximum likelihood estimator is
Two cautions about reading the likelihood, and they are the same caution twice. is not the probability that is true; is a fixed unknown constant and has no probability distribution in this framework. And is not a density in : it does not integrate to one, and its value at a point has no meaning on its own. Only ratios of likelihoods at different carry information, which is why the maximum is what gets used.
Why the logarithm
In practice one maximises instead. Since the logarithm is strictly increasing, the maximum is at the same place, and the product over observations becomes a sum:
Sums differentiate one term at a time, and they do not underflow: the likelihood of 1000 observations each of probability around 0.3 is about , which is zero in double precision, while its logarithm is a comfortable . Every serious implementation works on the log scale for both reasons.
The recipe is then calculus. Differentiate , set the derivative to zero, solve, and check the second derivative is negative. The derivative is called the score, and the equation is the likelihood equation.
The Bernoulli case
Let each observation be 0 or 1 with , and suppose of observations are 1. Then
Differentiating, . Setting this to zero gives , so and
The sample proportion, which everybody would have written down anyway, is the maximum likelihood estimator, and now it is derived rather than assumed. The second derivative is , negative everywhere, so this is a maximum.
Example. A coin gives 60 heads in 100 tosses. What is the maximum likelihood estimate of , and how much more likely does it make the data than ?
. The likelihood ratio is , whose logarithm is , so the ratio is . The observed data is 7.5 times more probable under than under a fair coin, which is a preference and nowhere near a proof.
Now you. A different coin gives 7 heads in 20 tosses. What is , and what is the log likelihood ratio against ?
Answer
. The log ratio is , so a ratio of 2.5. Weaker evidence from a smaller sample, as expected.
Poisson, exponential and normal
The same three steps handle every standard model, and the answers are worth having.
For Poisson counts with mean , , so , and . For exponential waiting times with rate , the density is , so , giving .
For the normal with both parameters unknown,
Differentiating with respect to gives , so whatever is. Substituting that and differentiating with respect to gives
which is the divide-by- version, not . Maximum likelihood is biased here, by exactly the factor derived in the previous lesson, so at it is 10 per cent low. That is a real defect and a small one: the bias vanishes as grows, and no general recipe can be both automatic and unbiased for every parameter at once.
Example. Ladislaus Bortkiewicz recorded deaths from horse kicks in 14 Prussian cavalry corps, and the classic subset covers 200 corps-years with 122 deaths. Estimate the Poisson rate and give its standard error, using .
deaths per corps-year, and . The estimate is about eleven standard errors away from zero and about seven from one, so the data pins the rate down well.
Now you. Fifty service times have mean 4.0 minutes. Estimate the exponential rate and its standard error, given that .
Answer
per minute, and per minute.
Curvature is precision
The recipe so far returns a point. It also returns, for free, an estimate of how precise that point is, and the mechanism is geometric: a sharply peaked log likelihood means that nearby parameter values explain the data much worse, so the data is informative; a flat one means many values do nearly as well.
Sharpness is curvature, so define the observed information as the negative second derivative of the log likelihood at the maximum, . The Fisher information is its expected value, . The large-sample result is that
For the Bernoulli case, evaluated at works out to , so
which is the formula used without justification in the first lesson, now derived. For the Poisson, , whose negative expectation is , giving . For the normal mean, the same route returns , agreeing with the exact derivation two lessons back.
There is a strong theorem behind this. Under regularity conditions, as grows the maximum likelihood estimator is consistent, its distribution approaches a normal centred at the true with variance , and that variance attains the Cramér-Rao lower bound. So maximum likelihood is asymptotically the best possible unbiased procedure, which is why it is the default and why almost every standard error printed by software is a square root of an inverse information.
Example. In a sample of 400 voters, 240 support a proposal. Give the maximum likelihood estimate and its standard error.
and . Doubling the sample from the 100-toss example halved neither the estimate nor the standard error but divided the latter by , from 0.049 to 0.0245.
Now you. With 14 successes in 40 trials, what are and its standard error?
Answer
and .
Invariance, and what it costs
A convenient property: maximum likelihood is invariant under reparameterisation. If maximises the likelihood for , then is the maximum likelihood estimate of for any function , because relabelling the axis does not move the peak.
So from , the maximum likelihood estimate of the odds is , and of the log odds is , with no fresh optimisation. Nothing comparable holds for unbiasedness, which is destroyed by nonlinear transformation as the previous lesson showed. Invariance is one of the reasons the method has spread: parameters get reparameterised constantly, into odds, rates, logs and proportions, and the estimates travel with them.
Standard errors travel too, by the delta method: if has standard error , then has approximate standard error , which is the first term of a Taylor expansion. For the log odds, , so the standard error of at with is . Every odds ratio reported with an interval in a medical journal comes from that calculation.
Where the method fails
The asymptotic theory rests on regularity conditions, and it is worth knowing the two ways they break.
The first is a parameter on the boundary of the support. For a uniform distribution on , the likelihood is for and zero below, so it has no stationary point at all: it is maximised at the smallest permitted value, . Differentiating would have found nothing. This estimator is biased low, since the maximum of a sample can never exceed , with , and its sampling distribution is nowhere near normal even for large . The previous lesson's rescaled version repairs the bias, and the normal approximation never arrives.
The second is small samples generally. Everything above is asymptotic, and "asymptotic" is not a sample size. With , a standard error taken from the curvature of the log likelihood can be badly wrong, and the estimator's distribution can be visibly skewed. Separation in logistic regression is the everyday version: when one group has no failures at all, the likelihood is maximised at an infinite coefficient, software reports an enormous estimate with an enormous standard error, and the honest conclusion is that the data cannot identify that parameter.
Maximum likelihood now supplies both an estimate and a standard error for essentially any model. A single number with a standard error beside it is still a poor way to communicate a result, because it invites the reader to treat the number as the answer. Turning the pair into an interval with a stated and checkable property is the next lesson.