Share to: share facebook share twitter share wa share telegram print page

Maximum likelihood estimation

In statistics, maximum likelihood estimation (MLE) is a method of estimating the parameters of an assumed probability distribution, given some observed data. This is achieved by maximizing a likelihood function so that, under the assumed statistical model, the observed data is most probable. The point in the parameter space that maximizes the likelihood function is called the maximum likelihood estimate.[1] The logic of maximum likelihood is both intuitive and flexible, and as such the method has become a dominant means of statistical inference.[2][3][4]

If the likelihood function is differentiable, the derivative test for finding maxima can be applied. In some cases, the first-order conditions of the likelihood function can be solved analytically; for instance, the ordinary least squares estimator for a linear regression model maximizes the likelihood when the random errors are assumed to have normal distributions with the same variance.[5]

From the perspective of Bayesian inference, MLE is generally equivalent to maximum a posteriori (MAP) estimation with a prior distribution that is uniform in the region of interest. In frequentist inference, MLE is a special case of an extremum estimator, with the objective function being the likelihood.

Principles

We model a set of observations as a random sample from an unknown joint probability distribution which is expressed in terms of a set of parameters. The goal of maximum likelihood estimation is to determine the parameters for which the observed data have the highest joint probability. We write the parameters governing the joint distribution as a vector so that this distribution falls within a parametric family where is called the parameter space, a finite-dimensional subset of Euclidean space. Evaluating the joint density at the observed data sample gives a real-valued function, which is called the likelihood function. For independent random variables, will be the product of univariate density functions:

The goal of maximum likelihood estimation is to find the values of the model parameters that maximize the likelihood function over the parameter space,[6] that is:

Intuitively, this selects the parameter values that make the observed data most probable. The specific value that maximizes the likelihood function is called the maximum likelihood estimate. Further, if the function so defined is measurable, then it is called the maximum likelihood estimator. It is generally a function defined over the sample space, i.e. taking a given sample as its argument. A sufficient but not necessary condition for its existence is for the likelihood function to be continuous over a parameter space that is compact.[7] For an open the likelihood function may increase without ever reaching a supremum value.

In practice, it is often convenient to work with the natural logarithm of the likelihood function, called the log-likelihood: Since the logarithm is a monotonic function, the maximum of occurs at the same value of as does the maximum of [8] If is differentiable in sufficient conditions for the occurrence of a maximum (or a minimum) are known as the likelihood equations. For some models, these equations can be explicitly solved for but in general no closed-form solution to the maximization problem is known or available, and an MLE can only be found via numerical optimization. Another problem is that in finite samples, there may exist multiple roots for the likelihood equations.[9] Whether the identified root of the likelihood equations is indeed a (local) maximum depends on whether the matrix of second-order partial and cross-partial derivatives, the so-called Hessian matrix

is negative semi-definite at , as this indicates local concavity. Conveniently, most common probability distributions – in particular the exponential family – are logarithmically concave.[10][11]

Restricted parameter space

While the domain of the likelihood function—the parameter space—is generally a finite-dimensional subset of Euclidean space, additional restrictions sometimes need to be incorporated into the estimation process. The parameter space can be expressed as

where is a vector-valued function mapping into Estimating the true parameter belonging to then, as a practical matter, means to find the maximum of the likelihood function subject to the constraint

Theoretically, the most natural approach to this constrained optimization problem is the method of substitution, that is "filling out" the restrictions to a set in such a way that is a one-to-one function from to itself, and reparameterize the likelihood function by setting [12] Because of the equivariance of the maximum likelihood estimator, the properties of the MLE apply to the restricted estimates also.[13] For instance, in a multivariate normal distribution the covariance matrix must be positive-definite; this restriction can be imposed by replacing where is a real upper triangular matrix and is its transpose.[14]

In practice, restrictions are usually imposed using the method of Lagrange which, given the constraints as defined above, leads to the restricted likelihood equations and

where is a column-vector of Lagrange multipliers and is the k × r Jacobian matrix of partial derivatives.[12] Naturally, if the constraints are not binding at the maximum, the Lagrange multipliers should be zero.[15] This in turn allows for a statistical test of the "validity" of the constraint, known as the Lagrange multiplier test.

Nonparametric maximum likelihood estimation

Nonparametric maximum likelihood estimation can be performed using the empirical likelihood.

Properties

A maximum likelihood estimator is an extremum estimator obtained by maximizing, as a function of θ, the objective function . If the data are independent and identically distributed, then we have this being the sample analogue of the expected log-likelihood , where this expectation is taken with respect to the true density.

Maximum-likelihood estimators have no optimum properties for finite samples, in the sense that (when evaluated on finite samples) other estimators may have greater concentration around the true parameter-value.[16] However, like other estimation methods, maximum likelihood estimation possesses a number of attractive limiting properties: As the sample size increases to infinity, sequences of maximum likelihood estimators have these properties:

  • Consistency: the sequence of MLEs converges in probability to the value being estimated.
  • Equivariance: If is the maximum likelihood estimator for , and if is a bijective transform of , then the maximum likelihood estimator for is . The equivariance property can be generalized to non-bijective transforms, although it applies in that case on the maximum of an induced likelihood function which is not the true likelihood in general.
  • Efficiency, i.e. it achieves the Cramér–Rao lower bound when the sample size tends to infinity. This means that no consistent estimator has lower asymptotic mean squared error than the MLE (or other estimators attaining this bound), which also means that MLE has asymptotic normality.
  • Second-order efficiency after correction for bias.

Consistency

Under the conditions outlined below, the maximum likelihood estimator is consistent. The consistency means that if the data were generated by and we have a sufficiently large number of observations n, then it is possible to find the value of θ0 with arbitrary precision. In mathematical terms this means that as n goes to infinity the estimator converges in probability to its true value:

Under slightly stronger conditions, the estimator converges almost surely (or strongly):

In practical applications, data is never generated by . Rather, is a model, often in idealized form, of the process generated by the data. It is a common aphorism in statistics that all models are wrong. Thus, true consistency does not occur in practical applications. Nevertheless, consistency is often considered to be a desirable property for an estimator to have.

To establish consistency, the following conditions are sufficient.[17]

  1. Identification of the model:

    In other words, different parameter values θ correspond to different distributions within the model. If this condition did not hold, there would be some value θ1 such that θ0 and θ1 generate an identical distribution of the observable data. Then we would not be able to distinguish between these two parameters even with an infinite amount of data—these parameters would have been observationally equivalent.

    The identification condition is absolutely necessary for the ML estimator to be consistent. When this condition holds, the limiting likelihood function (θ|·) has unique global maximum at θ0.
  2. Compactness: the parameter space Θ of the model is compact.

    The identification condition establishes that the log-likelihood has a unique global maximum. Compactness implies that the likelihood cannot approach the maximum value arbitrarily close at some other point (as demonstrated for example in the picture on the right).

    Compactness is only a sufficient condition and not a necessary condition. Compactness can be replaced by some other conditions, such as:

    • both concavity of the log-likelihood function and compactness of some (nonempty) upper level sets of the log-likelihood function, or
    • existence of a compact neighborhood N of θ0 such that outside of N the log-likelihood function is less than the maximum by at least some ε > 0.
  3. Continuity: the function ln f(x | θ) is continuous in θ for almost all values of x:

    The continuity here can be replaced with a slightly weaker condition of upper semi-continuity.
  4. Dominance: there exists D(x) integrable with respect to the distribution f(x | θ0) such that By the uniform law of large numbers, the dominance condition together with continuity establish the uniform convergence in probability of the log-likelihood:

The dominance condition can be employed in the case of i.i.d. observations. In the non-i.i.d. case, the uniform convergence in probability can be checked by showing that the sequence is stochastically equicontinuous.

If one wants to demonstrate that the ML estimator converges to θ0 almost surely, then a stronger condition of uniform convergence almost surely has to be imposed:

Additionally, if (as assumed above) the data were generated by , then under certain conditions, it can also be shown that the maximum likelihood estimator converges in distribution to a normal distribution. Specifically,[18] where I is the Fisher information matrix.

Functional invariance

The maximum likelihood estimator selects the parameter value which gives the observed data the largest possible probability (or probability density, in the continuous case). If the parameter consists of a number of components, then we define their separate maximum likelihood estimators, as the corresponding component of the MLE of the complete parameter. Consistent with this, if is the MLE for , and if is any transformation of , then the MLE for is by definition[19]

It maximizes the so-called profile likelihood:

The MLE is also equivariant with respect to certain transformations of the data. If where is one to one and does not depend on the parameters to be estimated, then the density functions satisfy

and hence the likelihood functions for and differ only by a factor that does not depend on the model parameters.

For example, the MLE parameters of the log-normal distribution are the same as those of the normal distribution fitted to the logarithm of the data. In fact, in the log-normal case if , then follows a log-normal distribution. The density of Y follows with standard Normal and , for .

Efficiency

As assumed above, if the data were generated by then under certain conditions, it can also be shown that the maximum likelihood estimator converges in distribution to a normal distribution. It is n -consistent and asymptotically efficient, meaning that it reaches the Cramér–Rao bound. Specifically,[18]

where is the Fisher information matrix:

In particular, it means that the bias of the maximum likelihood estimator is equal to zero up to the order 1/n .

Second-order efficiency after correction for bias

However, when we consider the higher-order terms in the expansion of the distribution of this estimator, it turns out that θmle has bias of order 1n. This bias is equal to (componentwise)[20]

where (with superscripts) denotes the (j,k)-th component of the inverse Fisher information matrix , and

Using these formulae it is possible to estimate the second-order bias of the maximum likelihood estimator, and correct for that bias by subtracting it: This estimator is unbiased up to the terms of order 1/n, and is called the bias-corrected maximum likelihood estimator.

This bias-corrected estimator is second-order efficient (at least within the curved exponential family), meaning that it has minimal mean squared error among all second-order bias-corrected estimators, up to the terms of the order 1/n2 . It is possible to continue this process, that is to derive the third-order bias-correction term, and so on. However, the maximum likelihood estimator is not third-order efficient.[21]

Relation to Bayesian inference

A maximum likelihood estimator coincides with the most probable Bayesian estimator given a uniform prior distribution on the parameters. Indeed, the maximum a posteriori estimate is the parameter θ that maximizes the probability of θ given the data, given by Bayes' theorem:

where is the prior distribution for the parameter θ and where is the probability of the data averaged over all parameters. Since the denominator is independent of θ, the Bayesian estimator is obtained by maximizing with respect to θ. If we further assume that the prior is a uniform distribution, the Bayesian estimator is obtained by maximizing the likelihood function . Thus the Bayesian estimator coincides with the maximum likelihood estimator for a uniform prior distribution .

Application of maximum-likelihood estimation in Bayes decision theory

In many practical applications in machine learning, maximum-likelihood estimation is used as the model for parameter estimation.

The Bayesian Decision theory is about designing a classifier that minimizes total expected risk, especially, when the costs (the loss function) associated with different decisions are equal, the classifier is minimizing the error over the whole distribution.[22]

Thus, the Bayes Decision Rule is stated as

"decide if otherwise decide "

where are predictions of different classes. From a perspective of minimizing error, it can also be stated as where if we decide and if we decide

By applying Bayes' theorem and if we further assume the zero-or-one loss function, which is a same loss for all errors, the Bayes Decision rule can be reformulated as: where is the prediction and is the prior probability.

Relation to minimizing Kullback–Leibler divergence and cross entropy

Finding that maximizes the likelihood is asymptotically equivalent to finding the that defines a probability distribution () that has a minimal distance, in terms of Kullback–Leibler divergence, to the real probability distribution from which our data were generated (i.e., generated by ).[23] In an ideal world, P and Q are the same (and the only thing unknown is that defines P), but even if they are not and the model we use is misspecified, still the MLE will give us the "closest" distribution (within the restriction of a model Q that depends on ) to the real distribution .[24]

Prediction bias

Maximum likelihood estimates of parameters can be substituted into expressions for the probability density function,