Maximum Likelihood
Every estimator so far has been produced by inspection: notice that the sample mean estimates the population mean, or that a rescaling removes a bias. Maximum likelihood is a procedure that manufactures an estimator from the model, mechanically, for any parametric family.
The idea is one sentence. Among all values the parameter could take, choose the one that makes the data you actually observed most probable.
1. The likelihood function
For a discrete model with parameter and observations from a random sample, the probability of seeing exactly this data is the product of the individual probabilities, by independence:
For a continuous model the probability mass function is replaced by the density:
Definition. is the likelihood function. The maximum likelihood estimator of is the value maximizing .
The reversal is what makes this a statistical object rather than a probabilistic one. The same expression read as a function of with fixed is a probability. Read as a function of with fixed at the observed data, it is a likelihood. The data are known and the parameter is the variable.
The likelihood is not a probability distribution over . It does not integrate to 1 over the parameter space, and nothing here treats as random.
Why the logarithm
Maximizing a product of terms is unpleasant, since differentiating requires the product rule times. Take logarithms:
The log-likelihood turns the product into a sum. This is legitimate because is strictly increasing, so it preserves the location of the maximum: whatever maximizes maximizes , and conversely.
2. The recipe
Four steps, and each earns marks separately on an exam.
- Write the likelihood. Substitute the pmf or density and take the product over .
- Take the log and simplify. Products become sums, exponents come down as multipliers.
- Differentiate with respect to , set to zero, solve. The resulting equation is the score equation, and its solution is the candidate.
- Verify it is a maximum with the second derivative.
Step 4 is not optional and is the step most often dropped. A vanishing first derivative locates a stationary point, which could be a minimum or an inflection. Showing is what makes the candidate a maximum, and it is separately marked.
Worked example: the Poisson
, with pmf . Find the MLE of .
Likelihood.
Log-likelihood.
The last term contains no , so it will vanish under differentiation. Carrying it costs nothing and dropping it early is fine as long as you say why.
Differentiate and solve.
Second-order check.
for all , provided . So the critical point is a maximum.
The estimator is .
Computing the estimate. With counts through occurring times over hours:
Worked example: the exponential
, density for .
so it is a maximum. The MLE of the rate is the reciprocal of the sample mean, which matches the fact that .
Worked example: the Bernoulli
, pmf for . Writing for the number of successes:
Multiply through by :
so the sample proportion is the MLE.
3. The invariance principle
Often the quantity of interest is not itself but a function of it.
Invariance principle. If is the MLE of and is an invertible function, then is the MLE of .
You do not redo the maximization. Find the MLE of the parameter, then apply the function.
Worked example. For , estimate .
Under a Poisson, . The map is strictly decreasing on and therefore invertible. Since the MLE of is , invariance gives
At the estimate is .
Invariance is about maximization, not about expectation, and confusing the two is the standard error. The MLE of is of the MLE. The expectation of is not of the expectation, unless is linear. That is why is the maximum likelihood estimator of and is nonetheless biased, as Jensen’s inequality shows.
4. When calculus fails
The recipe assumes the maximum is interior and the likelihood is differentiable there. When the parameter appears in the support rather than only in the functional form, neither holds.
Worked example: the uniform. , with density
The likelihood is
The case split is the whole content. If is smaller than some observation, that observation was impossible under the model, so the density is zero there and the whole product collapses to zero.
Differentiating gives , which is never zero. There is no stationary point, so step 3 produces nothing.
Argue directly instead. On the region where the likelihood is non-zero, is strictly decreasing in , so the likelihood is maximized by taking as small as it is allowed to be. The constraint is . Therefore
The recognition rule: if the parameter appears in the limits of the support, do not differentiate. Write the likelihood with its case split, see which direction it moves in, and push to the boundary the constraint allows.
The same reasoning gives the MLE of for a discrete uniform on : the likelihood is for , decreasing, so . From observed tickets the estimate is 66.
This estimator is biased, by the bounded-support argument: it can never exceed and is strictly below it with positive probability.
5. The method of moments
The second general recipe. Where maximum likelihood asks which parameter makes the data most probable, the method of moments asks which parameter makes the model’s moments match the data’s.
Definition. The th moment of is . The th sample moment is . If , the method of moments estimator is .
The recipe: express the parameter in terms of the population moments, then substitute sample moments for population moments.
Worked example: discrete uniform. For uniform on , . Solving for gives , so
From tickets : , so .
Worked example: continuous uniform. For , , so .
Note this differs from the MLE, which is . Two recipes applied to one model give two different estimators, and choosing between them is the mean squared error question. Here the method-of-moments estimator can be absurd: if the sample is then , but if the sample is then while an observation of 40 was seen, so the estimate is impossible.
Worked example: two moments. For with ,
so and
which is the sample variance with divisor , and is biased. Method of moments estimators are not guaranteed unbiased, and this is the standard counterexample.
6. Choosing between the two recipes
Use maximum likelihood by default. It uses the whole distributional form rather than a few summaries, and it satisfies invariance.
Use the method of moments when the likelihood is intractable or when the question asks for it. It is usually easier: one expectation and some algebra.
The two often coincide. For the Poisson and the Bernoulli both give . They diverge exactly where the distributional shape carries information the moments do not, which is the uniform case: the maximum knows about the boundary and the mean does not.
Vocabulary to deploy
- Likelihood function ; log-likelihood .
- Maximum likelihood estimator: the maximizer of the likelihood.
- Score equation ; second-order condition .
- Invariance principle: the MLE of is for invertible .
- Moment ; sample moment ; method of moments.
- Boundary maximum: the case where the parameter enters the support and the likelihood is maximized at a constraint rather than a stationary point.