Maximum likelihood: fit the parameter to the data

The question
Keep the data fixed. Change the model’s rate.
- 1 SeeMove a rate to fit counts.
- 2 TryCompare samples and test a boundary.
- 3 ProveBuild the maximization argument.
- 4 ApplyEstimate rates in new settings.
Before you start · 3 quick checks on independence, slopes, and estimates
Two ideas before you start
2 ideasA rate assigns probabilities to counts
Bars show the probabilities of different counts under a chosen Poisson rate.
Changing the rate changes the whole distribution. An observed count is one draw from that distribution.
Exact definition
A Poisson random variable \(X\) counts events in one fixed observation window. Its parameter \(\lambda\) is the expected count per window. For a positive rate and a nonnegative integer \(k\),
\[P_\lambda(X=k)=e^{-\lambda}\frac{\lambda^k}{k!}.\]Here \(k!\) is the product of the positive integers up to \(k\), with \(0!=1\). The model also allows \(\lambda=0\): then the count is zero with certainty. The Poisson lesson explains the distribution’s connection to rare events. Here the Poisson law is an assumption, not an approximation calculated from a binomial model.
Logs turn products into sums
The natural logarithm rises as its positive input rises.
The natural logarithm preserves the ordering of positive numbers. It also replaces multiplication with addition.
Exact definition
For positive \(a,b\), \(\ln(ab)=\ln a+\ln b\). The derivative of \(\ln a\) is \(1/a\), which is positive. Thus maximizing a positive likelihood is equivalent to maximizing its logarithm. Products of many small probabilities can become too small for computer arithmetic; summing their logarithms avoids forming that product.
We use the convention \(\ln 0=-\infty\) when a candidate assigns zero probability to the observed data. This is an extended value used for comparison, not a finite derivative at zero.
Likelihood: what stays fixed?
Suppose \(X_1,\ldots,X_n\) are independent Poisson counts with the same rate, measured over equal windows. The recorded values \(x_1,\ldots,x_n\) stay fixed. The likelihood \(L(\lambda)\) is the probability of this particular recorded sequence, viewed as a function of the candidate rate:
\[L(\lambda)=\prod_{i=1}^{n}P_\lambda(X_i=x_i).\]A maximum likelihood estimate, or MLE, is an allowed parameter value where this function is largest, if such a value exists. The likelihood of a candidate rate is a probability of the data, not the probability that this candidate is the true rate. The parameter is fixed and unknown in this model; we have not assigned probabilities to possible parameter values. For continuous data the corresponding definition uses a joint density, since the probability of an exact measured value is zero.
Tune a rate and check the fit
- Read the observed counts, then move the rate slider to open the score plot.
- Seek the largest log-likelihood. A less negative score is larger.
- Press Check my rate to compare your selection with the analytic maximum.
Assume independent Poisson counts from equal windows with one common, constant rate. The counts shown are a fixed teaching dataset. Changing the slider changes the proposed mechanism, not the observations. The candidate rate is an expected count, so it need not be an integer.
For these equal-window Poisson data, the maximizing rate is the total count divided by the number of windows. This is the sample mean. The formula will follow from a derivative in the proof. The plot suggests where to look; the proof explains why no unplotted candidate can do better.
The highest score is still a negative logarithm. That is normal: a particular sequence can have small probability even at its best-fitting rate. Comparing likelihood values for the same observations is meaningful. Comparing raw likelihood heights for different sample sizes does not, by itself, measure which dataset is more informative.
Compare the evidence in another sample
Now suppose an additional, independent batch happens to record exactly the same counts as the first. It uses the same window lengths and common Poisson rate. This means genuinely new observations, not a second copy of the same records.
| Independent batches | Log difference | Ratio |
|---|
Relative likelihood divides a candidate’s likelihood by the maximum for that same sample. It has no units and is not a posterior probability. The best-fitting rate can remain unchanged while the data distinguish it more strongly from a fixed competing rate. Duplicating rows in a file provides no new observations and does not justify multiplying independent likelihood factors again.
Use what you found: fit two new datasets
- Move the rate and press Check this goal. Each goal supplies a different fixed dataset.
- After reaching a goal, press Next. The next goal resets the slider.
Check the allowed parameter set
If all counts are zero, the likelihood is \(e^{-n\lambda}\). It decreases as the rate increases. Allowing \(\lambda=0\) gives a maximum at the endpoint, even though there is no interior stationary point. If the model instead requires a strictly positive rate, that same sample has no MLE: the likelihood approaches its supremum as the rate tends to zero, without attaining it.
The all-zero fit does not prove that events are impossible. A positive true rate can generate a run of empty windows. The estimate describes what this finite sample favors within the chosen family.
Find the maximum over every allowed rate
Let \(n\ge1\) independent observations have a common Poisson rate \(\lambda\ge0\). Fix their nonnegative integer values \(x_i\), and write \(S=\sum_i x_i\). The unique maximum likelihood estimate is \(\hat\lambda=S/n\).
For the choice exercise, assume \(S\gt0\) and differentiate only at \(\lambda\gt0\). Put \(C=\sum_i\ln(x_i!)\). Taking the log of the independent product gives
\[\ell(\lambda)=-n\lambda+S\ln\lambda-C.\]The constant \(C\) does not depend on the rate. The all-zero case is handled directly below, not by dividing by its total.
For a positive total, the derivative is positive below the stationary rate and negative above it. The log-likelihood therefore rises and then falls on the whole positive half-line. The boundary has zero likelihood, whereas the stationary rate has positive likelihood. Together these facts give a unique global maximum.
When \(S=0\), nonnegative observations force every count to be zero. Then \(L(\lambda)=e^{-n\lambda}\), including the endpoint. Since \(n\ge1\), this function is strictly decreasing, so its unique maximum over nonnegative rates is zero. This proves the theorem for every permitted sample.
A zero derivative alone would not suffice in a general model. It can describe a minimum or another stationary point, and a largest value might occur at a boundary or fail to exist. Here the sign and boundary arguments finish the job. The derivative lesson gives the local slope interpretation used in this argument.
Fit rates and interpret the result
Use the stated model for each dataset. Enter a decimal without units. Each problem accepts answers within 0.001 of the unrounded value and includes hints and a worked solution.
Does maximizing likelihood make an estimator unbiased?
Not in general. Maximizing the likelihood of one recorded sample gives an estimate, a number. Applied to every possible sample, the same rule defines an estimator, a random quantity such as \(\bar X=(X_1+\cdots+X_n)/n\). Bias compares the estimator's expected value across repeated samples with the true parameter, as in bias and variance. Under the independent, common-rate Poisson model, \(\bar X\) happens to be unbiased because each observation has expectation equal to the rate. Its variance is \(\lambda/n\).
Those sampling properties depend on the sampling assumptions. Shared shocks, changing rates, or unequal observation windows can invalidate a common-rate iid analysis. An MLE is only as relevant as the family being fitted; the act of maximizing does not test that family against reality. This lesson establishes the finite-sample Poisson fit. It makes no general claim that every MLE is unbiased or normally distributed.
Further reading
- G. Casella and R. L. Berger, Statistical Inference, chapter 7, “Point Estimation.”