Hexa Scholar

Maximum likelihood: fit the parameter to the data

A navy dispenser with a brass knob beside a cream tray of gold beads.
A dispenser and its output: choose a setting to explain the observed counts.

The question

Keep the data fixed. Change the model’s rate.

  1. 1 SeeMove a rate to fit counts.
  2. 2 TryCompare samples and test a boundary.
  3. 3 ProveBuild the maximization argument.
  4. 4 ApplyEstimate rates in new settings.
Before you start · 3 quick checks on independence, slopes, and estimates

Two ideas before you start

2 ideas

A 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.

1 See

Tune a rate and check the fit

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.

2 Try

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.

3 Prove

Find the maximum over every allowed rate

Theorem: common Poisson 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.

4 Apply

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.

Key point Specify the sampling law, exposure units, and allowed parameter values before writing a likelihood. Interpret the estimate within that model.
Level Intermediate undergraduatePrerequisites Poisson counts, derivatives, and bias versus varianceTime About 35 min

Further reading