L(θ) says how probable the observed data would be if the parameter were θ. It is not a probability distribution over θ: it need not integrate to one, and only ratios L(θ1)/L(θ2) are meaningful. Multiplying by a prior and normalising would make it a Bayesian posterior; without a prior it is just a ranking of parameter values.
The maximum-likelihood estimateθ^ is the value that makes the data most probable. Work with ℓ: the product becomes a sum, and the maximiser is the same because log is increasing. The recipe:
Write ℓ(θ), dropping terms that do not involve θ.
Solve the score equationℓ′(θ)=0.
Check it is a maximum (ℓ′′<0) and check the boundary of the parameter space.
The four standard models
Bernoulli(p), k successes in n trials: ℓ(p)=klogp+(n−k)log(1−p). Setting ℓ′(p)=k/p−(n−k)/(1−p)=0 gives p^=k/n.
Poisson(λ): ℓ(λ)=(∑xi)logλ−nλ (dropping −∑logxi!). Then ℓ′(λ)=∑xi/λ−n=0 gives λ^=xˉ.
Exponential(λ), density λe−λx: ℓ(λ)=nlogλ−λ∑xi, so n/λ=∑xi and λ^=1/xˉ.
Normal(μ,σ2): ℓ=−2nlogσ2−2σ21∑(xi−μ)2. The μ-derivative gives μ^=xˉ. Substituting and differentiating in σ2:
−2σ2n+2σ41∑(xi−xˉ)2=0⟹σ^2=n1∑(xi−xˉ)2.
A model where calculus fails: Uniform(0,θ). L(θ)=θ−n for θ≥maxxi and 0 otherwise. It is decreasing in θ, so the maximum sits on the boundary: θ^=maxxi. Setting a derivative to zero would find nothing.
Invariance
If θ^ is the MLE of θ, then g(θ^) is the MLE of g(θ). The MLE of σ is σ^2; the MLE of the exponential mean is xˉ; the MLE of P(X=0)=e−λ for a Poisson is e−xˉ. No new optimisation is needed. (Unbiasedness is not invariant: if θ^ is unbiased, g(θ^) usually is not.)
Standard errors from the curvature
A sharply peaked log-likelihood pins θ down; a flat one does not. The Fisher information per observation measures the expected curvature:
I(θ)=−E[∂θ2∂2logf(X;θ)].
Under regularity conditions (the support does not depend on θ, the true value is interior, the model is correct), the MLE is consistent and asymptotically normal:
θ^≈N(θ,nI(θ)1),SE(θ^)≈nI(θ^)1.
The Cramér–Rao bound says no unbiased estimator has variance below 1/(nI(θ)), so the MLE is asymptotically as efficient as possible. In practice you can also use the observed information−ℓ′′(θ^) in place of nI(θ^).
Model
I(θ) per observation
SE of MLE
Bernoulli(p)
1/(p(1−p))
p^(1−p^)/n
Poisson(λ)
1/λ
λ^/n
Exponential(λ)
1/λ2
λ^/n
Normal mean, σ known
1/σ2
σ/n
Likelihood also gives a test. The likelihood-ratio statistic2[ℓ(θ^)−ℓ(θ0)] is approximately χ12 under H0:θ=θ0, so values above 1.962≈3.84 reject at 5%.
Worked example
is the coin fair? Three ways
A coin lands heads 60 times in 100 flips. Find the MLE of p, its standard error, a 95% Wald interval, and the likelihood-ratio test of p=0.5.
Show solutionHide solution
p^=60/100=0.6.
With I(p)=1/(p(1−p)), SE=0.6×0.4/100=0.0024≈0.049. The Wald interval is 0.6±1.96×0.049=0.6±0.096, or [0.504,0.696], which just excludes 0.5.
That exceeds 3.84; the p-value is P(χ12>4.03)≈0.045. The z-test using the null standard error 0.25/100=0.05 gives z=0.1/0.05=2 and p-value 0.0455. All three agree here because n is large and p^ is not near 0 or 1. With small samples or extreme p^ the Wald interval behaves worst (it can even extend below 0); the likelihood-ratio approach holds up best.
Worked example
arrival rate of trades, and its bias
You record 40 gaps between trades, modelled as i.i.d. exponential, and they sum to 20 seconds. Estimate the arrival rate λ with a standard error and a 95% interval. Is the estimator biased?
Show solutionHide solution
λ^=n/∑xi=40/20=2 trades per second.
With I(λ)=1/λ2, SE≈λ^/n=2/40≈0.316, so the interval is 2±1.96×0.316=2±0.62, or about [1.38,2.62].
Bias: ∑Xi∼Gamma(n,λ) and E[1/∑Xi]=λ/(n−1), so
E[λ^]=n−1nλ.
The MLE overestimates the rate by a factor n/(n−1): 2.6% here, 25% with n=5 (a simulation with λ=2, n=5 averages 2.50). The unbiased version is (n−1)/∑xi=39/20=1.95. Note that the MLE of the mean gap, xˉ, is unbiased; the bias appears because 1/x is convex (Jensen's inequality).
MLE bias: the normal variance
The MLE σ^2=n1∑(xi−xˉ)2 is biased. Deviations are measured from xˉ, which is fitted to the same data and therefore closer to the points than μ is. Since ∑(xi−xˉ)2/σ2∼χn−12,
E[σ^2]=nn−1σ2.
Dividing by n−1 instead gives the unbiased s2. The bias is O(1/n) and vanishes asymptotically, which is the general pattern for MLEs. In regression with p fitted coefficients the same logic gives a divisor of n−p. A quick simulation confirms the factor for n=10:
import random
random.seed(3)
n, reps, total = 10, 100_000, 0.0
for _ in range(reps):
x = [random.gauss(0, 1) for _ in range(n)]
m = sum(x) / n
total += sum((v - m) ** 2 for v in x) / n # MLE divides by n
print(round(total / reps, 3)) # 0.899, close to (n - 1) / n = 0.9
Knowledge check
Daily counts of a rare event are 2,0,3,1,4, modelled as Poisson. What is the MLE of the probability that a day has no events?
Knowledge check
Ten draws from Uniform(0,θ) have mean 4.6 and maximum 8.4. What is the maximum-likelihood estimate of θ?
Knowledge check
An estimate of a win probability is 0.55 from 400 independent trades. What is the approximate standard error from the Fisher information?