On this page
You toss a coin 10 times and get 7 heads. Your best guess for the chance of heads is 0.7. Maximum likelihood estimation turns that instinct into mathematics, and then handles cases where instinct has no answer.
What is maximum likelihood estimation?
Maximum likelihood estimation (MLE) is "a method of estimating the parameters of an assumed probability distribution, given some observed data", in the words of the Wikipedia article on maximum likelihood estimation. The parameter value that makes the observed data most probable is called the maximum likelihood estimate.
The modern method is Ronald Fisher's. The Wikipedia article credits him with creating it between 1912 and 1922. One of his papers from that period is On the mathematical foundations of theoretical statistics, published in 1922 in the Philosophical Transactions of the Royal Society.
The recipe has three steps:
Write the likelihood: the probability of your exact data, as a function of the unknown parameter.
Take its logarithm to get the log-likelihood.
Differentiate, set the derivative to zero, solve, and check it is a maximum.
Why do we use the log-likelihood?
The likelihood of independent observations is a product, and products are painful to differentiate. The log turns the product into a sum. Because the logarithm is strictly increasing, the value that maximises the likelihood also maximises its logarithm, as the Wikipedia MLE article notes. You lose nothing and gain an easier derivative.
Worked example 1: what is the MLE for a coin?
With 7 heads in 10 tosses, the likelihood is L(p) = p^7 (1 − p)^3 (the binomial coefficient is a constant and does not move the peak).
Log-likelihood: ℓ(p) = 7 ln p + 3 ln(1 − p).
Derivative: 7/p − 3/(1 − p) = 0.
Solve: 7(1 − p) = 3p, so p̂ = 7/10 = 0.7.
Check the numbers: L(0.7) = 0.7^7 × 0.3^3 ≈ 0.00222, while L(0.5) = 0.5^10 ≈ 0.00098. The data are more than twice as probable if p = 0.7 than if the coin is fair. With s heads in n tosses the same calculation gives p̂ = s/n; the Wikipedia article works it through for 49 heads in 80 tosses and gets 49/80.
The picture at the top plots L(p) for 7 heads in 10 and 35 heads in 50. Both peak at 0.7, but more data gives a narrower peak.
Worked example 2: what is the MLE for an exponential distribution?
Suppose you time four waits at a bus stop: 4, 6, 2 and 8 minutes. If waits follow an exponential distribution with rate λ, each wait x has density λe^(−λx), so for n waits the log-likelihood is ℓ(λ) = n ln λ − λ Σx.
Derivative: n/λ − Σx = 0.
Solve: λ̂ = n/Σx = 1/x̄, one over the sample mean.
The Wikipedia article on the exponential distribution gives the same result, and StatLect's derivation concludes that the estimator "is just the reciprocal of the sample mean". Here x̄ = 20/4 = 5 minutes, so λ̂ = 0.2 per minute, the rate that matches an average wait of 5 minutes.
Why does the normal variance MLE divide by n, not n−1?
For normal data, the Wikipedia MLE article derives μ̂ = x̄ and σ̂² = (1/n) Σ(xᵢ − x̄)². MLE asks only which value makes the data most probable, not whether the estimate is right on average.
On average it is not. The same article shows that the expected value of σ̂² is (n − 1)/n × σ², so the estimator is biased: it slightly underestimates the true variance. The reason is that the deviations are measured from x̄, and the sum of squared deviations is smallest about x̄, so it is never larger than the sum about the true mean μ. Dividing by n − 1 instead removes that bias, which is why the usual sample variance divides by n − 1.
Try it with the data 2, 4 and 6. The mean is 4 and the squared deviations add up to 4 + 0 + 4 = 8.
MLE: 8/3 ≈ 2.67.
Unbiased sample variance: 8/2 = 4.
With n = 3 the factor (n − 1)/n is 2/3; with large n the two answers almost agree. The NIST handbook makes the general point: maximum likelihood estimates can be heavily biased for small samples, and they become unbiased as the sample size increases.
How should you practise MLE?
Redo the coin and exponential derivations by hand without looking.
Change the data and predict the answer before calculating.
Sketch the likelihood curve and mark its peak.
Compute both normal variances on a small data set, then add points and watch the gap shrink.
If logarithms or derivatives feel shaky, the Fermi Concept Library has a lesson for every concept in physics, chemistry, biology, mathematics and computing. For more practice, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer.



