How to Find the MLE of a Uniform Distribution
At a glance
- 1. Choose the model
Specify which endpoint or endpoints of the uniform distribution are unknown.
- 2. Write the likelihood
Multiply the sample densities and include the parameter values that make every observation possible.
- 3. Maximize over parameters
For Uniform(0, θ), the likelihood decreases with θ, so choose the smallest feasible value.
- 4. Check the estimate
Substitute the estimate into the support constraints and distinguish a maximum from a supremum.
The maximum-likelihood estimate (MLE) depends on how the uniform distribution is parameterized. The most common textbook problem assumes independent observations from Uniform(0, θ), where the lower endpoint is 0 and the upper endpoint θ is unknown. In that model, the MLE is the largest observation in the sample.
If both endpoints are unknown, the usual MLEs are instead the sample minimum and sample maximum. The likelihood makes clear why these answers differ.
The common case: Uniform(0, θ)
Let be independent observations from a uniform distribution on , where . The density of one observation is
Write for the sample maximum. Independence gives the likelihood
assuming all observed values are nonnegative. The indicator is 1 when the parameter makes every observation possible and 0 otherwise. Thus, values of below the sample maximum have zero likelihood. For all feasible values , the likelihood decreases as increases. If , its largest value is therefore attained at the smallest feasible parameter:
This is a boundary maximum: the fitted upper endpoint is exactly the largest observed value. In the edge case , the likelihood is unbounded as , so no MLE exists; this event has probability zero under the continuous model.
Worked example
Suppose the observations are . For the model , the likelihood is
Among feasible values, this is largest when is as small as possible. Hence . The maximum likelihood is .
If both endpoints are unknown
Now suppose , with both and unknown and . The likelihood is
where . To maximize the likelihood, make the interval as short as possible while still containing every observation. Under the usual closed-support convention, this gives
For the example above, the estimates are and . If the model requires observations to lie strictly between the endpoints, these values may not be allowed: the likelihood then has a supremum as the endpoints approach the sample minimum and maximum, but no attained maximum. Textbooks commonly use the closed-support convention, under which the estimates above are MLEs.
What if the lower endpoint is known but not zero?
For with known lower endpoint and unknown upper endpoint, the same reasoning gives , provided all observations are at least and . If all observations equal , the likelihood is unbounded as , so no MLE exists. If instead the upper endpoint is known and the lower endpoint is unknown, the MLE of the lower endpoint is the sample minimum, provided all observations are at most and . If all observations equal , no MLE exists.
A different model can produce a different result. For example, if the interval has known width 1 and unknown location, , the likelihood is constant over all values for which the interval contains the data. Every feasible value is then an MLE; there need not be a unique one.
Common mistakes
- Using the sample mean as the MLE. For Uniform(0, θ), the sample mean is not the MLE; the sample maximum is. The mean is a different estimator.
- Ignoring the support constraint. The likelihood is zero if even one observation falls outside the proposed interval. The indicator in the likelihood is essential.
- Assuming there is one answer for every uniform model. The result changes when the lower endpoint, upper endpoint, width, or location is known or unknown.
- Confusing MLE with unbiased estimation. For Uniform(0, θ), the MLE is generally biased downward: its expected value is . An unbiased estimator is , but it is not the MLE.
- Overlooking degenerate samples. With both endpoints unknown, a sample whose observations are all identical would require an interval of zero width. Such a sample has probability zero under a continuous uniform model, but for that data the ordinary positive-width likelihood has no finite maximum.
For the standard Uniform(0, θ) model, the key operation is simple: find the largest observation. Before applying it, check that zero is the known lower endpoint and that θ is the unknown upper endpoint.
References
- Statistical Inference, George Casella and Roger L. Berger
- Introduction to Mathematical Statistics, Robert V. Hogg, Joseph W. McKean, and Allen T. Craig
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.