Maximum likelihood estimation (MLE) is a popular statistical method used for fitting a statistical model to data, and providing estimates for the model's parameters.
The method of maximum likelihood corresponds to many wellknown estimation methods in statistics. For example, suppose you are interested in the heights of Americans. You have a sample of some number of Americans, but not the entire population, and record their heights. Further, you are willing to assume that heights are normally distributed with some unknown mean and variance. The sample mean is then the maximum likelihood estimator of the population mean, and the sample variance is a close approximation to the maximum likelihood estimator of the population variance (see examples below).
For a fixed set of data and underlying probability model, maximum likelihood picks the values of the model parameters that make the data "more likely" than any other values of the parameters would make them. Maximum likelihood estimation gives a unique and easy way to determine solution in the case of the normal distribution and many other problems, although in very complex problems this may not be the case. If a uniform prior distribution is assumed over the parameters, the maximum likelihood estimate coincides with the most probable values thereof.
Contents 
Maximumlikelihood estimation was recommended, analyzed and vastly popularized by R. A. Fisher between 1912 and 1922 (although it had been used earlier by Gauss, Laplace, Thiele, and F. Y. Edgeworth).^{[1]} Reviews of the development of maximum likelihood have been provided by a number of authors.^{[2]}
Suppose there is a sample x_{1}, x_{2}, …, x_{n} of n independent observations, drawn from an unknown probability density (or probability mass) f_{0}(·). It is however known that the function f_{0} belongs to a certain family of distributions { f(·θ), θ ∈ Θ }, called the parametric model, so that f_{0} corresponds to θ = θ_{0}, which is called the “true value” of the parameter. It is desirable to find the value (the estimator) which would be as close to the true value θ_{0} as possible.
Both the observed variables x_{i} and the parameters θ can be vectors.
The idea behind the method of maximum likelihood is to first find the joint density function for all observations. For iid sample this density function will be
Now we want to look at this function at a different angle: let the observed values x_{1}, x_{2}, …, x_{n} be fixed “parameters” of this function, whereas the value of θ is allowed to vary freely. From this point of view this function is called the likelihood:
In practice it is always more convenient to work with the scaled logarithm of the likelihood function, called the loglikelihood:
The method of maximum likelihood estimates θ_{0} by finding the value of θ that maximizes . This is the maximum likelihood estimator (MLE) of θ_{0}:
The estimator is the same regardless whether we optimize the likelihood or the loglikelihood function.
For selected models the maximum likelihood estimator can be found as an explicit function of the observed data x_{1}, …, x_{n}. More often however, the closedform solution to this maximization problem doesn’t exist, and the solution has to be found numerically using various optimization algorithms. For certain problems the maximum likelihood estimates may not be unique, or even may not exist (meaning that the loglikelihood function goes to ∞ for certain values of the parameters θ).
In the exposition above we have assumed that the data are independent and identically distributed. The method can be applied however to a broader setting, as long as it is possible to write the joint density function f(x_{1},…,x_{n}  θ), and its parameter θ has a finite dimension which does not depend on the sample size n. In a simpler extension we may allow for data heterogeneity, so that the joint density is equal to f_{1}(x_{1}θ) · f_{2}(x_{2}θ) · … · f_{n}(x_{n}θ). In a more complicated case of time series models we have to drop the independence assumption as well.
Maximum likelihood is the extremum estimator based upon the objective function
and its sample analogue, the loglikelihood . The expectation here is taken with respect to the true density f(·θ_{0}).
For a large class of problems, the maximum likelihood estimator possesses a number of attractive asymptotic properties:
By the mathematical meaning of the word asymptotic, asymptotic properties are properties which are approached in the limit, that is when the samplesize goes to infinity. Logically, asymptotic properties are irrelevant for finite samples.^{[3]} The theory does not tell us how large the sample needs to be in order to obtain a good enough degree of approximation. Many statisticians believe that asymptotic properties are approximately true when the sample size is "large enough" in the following sense: Some asymptotic properties appear to be approximately true, when the sample size is moderately large. However, such asymptotic heuristics are supported by experience and simulation more than mathematics.^{[4]} When statisticians do not have a better alternative, they often make inferences about the estimated parameters by extrapolating to the asymptotic Gaussian distribution of the MLE. When statisticians do this, the Fisher information matrix is often usefully estimated by the observed information matrix.
However these properties hold only if certain regularity conditions for the model hold, these regularity requirements are discussed in more details below.
Under certain (fairly weak) conditions outlined below, the maximum likelihood estimator is consistent. The consistency means that having a sufficiently large number of observations n, 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) too:
The conditions for consistency mentioned above are:^{[5]}
The identification condition establishes that the loglikelihood has a unique global maximum. Compactness however is needed to ensure 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 not a necessary condition, and can be replaced by some other requirements, such as:
The dominance condition can be employed in the case of i.i.d. observations. In the noni.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:
Maximumlikelihood estimators can lack asymptotic normality and can be inconsistent if there is a failure of one (or more) of the above regularity conditions:
Estimate on boundary. Sometimes the maximum likelihood estimate lies on the boundary of the set of possible parameters, or (if the boundary is not, strictly speaking, allowed) the likelihood gets larger and larger as the parameter approaches the boundary. Standard asymptotic theory needs the assumption that the true parameter value lies away from the boundary. If we have enough data, the maximum likelihood estimate will keep away from the boundary too. But with smaller samples, the estimate can lie on the boundary. In such cases, the asymptotic theory clearly does not give a practically useful approximation. Examples here would be variancecomponent models, where each component of variance, σ^{2}, must satisfy the constraint σ^{2} ≥0.
Data boundary parameterdependent. For the theory to apply in a simple way, the set of data values which has positive probability (or positive probability density) should not depend on the unknown parameter. A simple example where such parameterdependence does hold is the case of estimating θ from a set of independent identically distributed when the common distribution is uniform on the range (0,θ). For estimation purposes the relevant range of θ is such that θ cannot be less than the largest observation. Because the interval (0,θ) is not compact, there exists no maximum for the likelihood function: For any estimate of theta, there exists a greater estimate that also has greater likelihood. In contrast, the interval [0,θ] includes the endpoint θ and is compact, in which case the maximumlikelihood estimator exists. However, in this case, the maximumlikelihood estimator is biased. Asymptotically, this maximumlikelihood estimator is not normally distributed.^{[6]}
Nuisance parameters. For maximum likelihood estimations, a model may have a number of nuisance parameters. For the asymptotic behaviour outlined to hold, the number of nuisance parameters should not increase with the number of observations (the sample size). A wellknown example of this case is where observations occur as pairs, where the observations in each pair have a different (unknown) mean but otherwise the observations are independent and Normally distributed with a common variance. Here for 2N observations, there are N+1 parameters. It is wellknown that the maximum likelihood estimate for the variance does not converge to the true value of the variance.
Increasing information. For the asymptotics to hold in cases where the assumption of independent identically distributed observations does not hold, a basic requirement is that the amount of information in the data increases indefinitely as the sample size increases. Such a requirement may not be met if either there is too much dependence in the data (for example, if new observations are essentially identical to existing observations), or if new independent observations are subject to an increasing observation error.
Some regularity conditions which ensure this behavior are:
Suppose that conditions for consistency of maximum likelihood estimator are satisfied, and ^{[7]}
Then the maximum likelihood estimator has asymptotically normal distribution:
Proof, skipping the technicalities:
Since the loglikelihood function is differentiable, and θ_{0} lies in the interior of the parameter set, in the maximum the firstorder condition will be satisfied:
When the loglikelihood is twice differentiable, this expression can be expanded into a Taylor series around the point θ = θ_{0}:
where is some point intermediate between θ_{0} and . From this expression we can derive that
Here the expression in square brackets converges in probability to H = E[−∇_{θθ}ln f(xθ_{0})] by the law of large numbers. The continuous mapping theorem ensures that the inverse of this expression also converges in probability, to H^{−1}. The second sum, by the central limit theorem, converges in distribution to a multivariate normal with mean zero and variance matrix equal to the Fisher information I. Thus, applying the Slutsky’s theorem to the whole expression, we obtain that
Finally, the information equality guarantees that when the model is correctly specified, matrix H will be equal to the Fisher information I, so that the variance expression simplifies to just I^{−1}.
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 g(θ) is any transformation of θ, then the MLE for α = g(θ) is by definition
It maximizes the socalled profile likelihood:
The MLE is also invariant with respect to certain transformations of the data. If Y = g(X) where g 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 X and Y differ only by a term that does not depend on the model parameters.
For example, the MLE parameters of the lognormal distribution are the same as those of the normal distribution fitted to the logarithm of the data.
The standard asymptotics tells that the maximumlikelihood estimator is √nconsistent and asymptotically efficient, meaning that it reaches the CramérRao bound:
where I is the Fisher information matrix:
In particular, it means that the bias of the maximumlikelihood estimator is equal to zero up to the order n^{−1/2}. However when we consider the higherorder terms in the expansion of the distribution of this estimator, it turns out that θ_{mle} has bias of order n^{−1}. This bias is equal to (componentwise) ^{[8]}
where Einstein’s summation convention over the repeating indices has been adopted; I^{ jk} denotes the j,kth component of the inverse Fisher information matrix I^{−1}, and
Using these formulas it is possible to estimate the secondorder bias of the maximum likelihood estimator, and correct for that bias by subtracting it:
This estimator is unbiased up to the terms of order n^{−1}, and is called the biascorrected maximum likelihood estimator.
This biascorrected estimator is secondorder efficient (at least within the curved exponential family), meaning that it has minimal mean squared error among all secondorder biascorrected estimators, up to the terms of the order n^{−2}. It is possible to continue this process, that is to derive the thirdorder biascorrection term, and so on. However as was shown by Kano (1996), the maximumlikelihood estimator is not thirdorder efficient.
Consider a case where n tickets numbered from 1 to n are placed in a box and one is selected at random (see uniform distribution); thus, the sample size is 1. If n is unknown, then the maximumlikelihood estimator of n is the number m on the drawn ticket. (The likelihood is 0 for n < m, 1/n for n ≥ m, and this is greatest when n = m. Note that the maximum likelihood estimate of n occurs at the lower extreme of possible values {m, m + 1, ...}, rather than somewhere in the “middle” of the range of possible values, which would result in less bias.) The expected value of the number m on the drawn ticket, and therefore the expected value of , is (n + 1)/2. As a result, the maximum likelihood estimator for n will systematically underestimate n by (n − 1)/2 with a sample size of 1.
Consider tossing an unfair coin 80 times: i.e., the sample might be something like x_{1} = H, x_{2} = T, ..., x_{80} = T, and the count of the number of HEADS "H" is observed. Call the probability of tossing a HEAD p, and the probability of tossing TAILS 1 − p (so here p is θ above). Suppose the outcome is 49 HEADS and 31 TAILS, and suppose the coin was taken from a box containing three coins: one which gives HEADS with probability p = 1/3, one which gives HEADS with probability p = 1/2 and another which gives HEADS with probability p = 2/3. The coins have lost their labels, so which one it was is unknown. Using maximum likelihood estimation the coin that has the largest likelihood can be found, given the data that were observed. By using the probability mass function of the binomial distribution with sample size equal to 80, number successes equal to 49 but different values of p (the "probability of success"), the likelihood function (defined below) takes one of three values:
The likelihood is maximized when p = 2/3, and so this the maximum likelihood estimate for p.
Now suppose that there was only one coin but its p could have been any value 0 ≤ p ≤ 1. The likelihood function to be maximised is
and the maximisation is over all possible values 0 ≤ p ≤ 1.
One way to maximize this function is by differentiating with respect to p and setting to zero:
which has solutions p = 0, p = 1, and p = 49/80. The solution which maximizes the likelihood is clearly p = 49/80 (since p = 0 and p = 1 result in a likelihood of zero). Thus the maximum likelihood estimator for p is 49/80.
This result is easily generalized by substituting a letter such as t in the place of 49 to represent the observed number of 'successes' of our Bernoulli trials, and a letter such as n in the place of 80 to represent the number of Bernoulli trials. Exactly the same calculation yields the maximum likelihood estimator t / n for any sequence of n Bernoulli trials resulting in t 'successes'.
For the normal distribution which has probability density function
the corresponding probability density function for a sample of n independent identically distributed normal random variables (the likelihood) is
or more conveniently:
where is the sample mean.
This family of distributions has two parameters: θ = (μ, σ), so we maximize the likelihood, , over both parameters simultaneously, or if possible, individually.
Since the logarithm is a continuous strictly increasing function over the range of the likelihood, the values which maximize the likelihood will also maximize its logarithm. Since maximizing the logarithm often requires simpler algebra, it is the logarithm which is maximized below. (Note: the loglikelihood is closely related to information entropy and Fisher information.)
which is solved by
This is indeed the maximum of the function since it is the only turning point in μ and the second derivative is strictly less than zero. Its expectation value is equal to the parameter μ of the given distribution,
which means that the maximumlikelihood estimator is unbiased.
Similarly we differentiate the log likelihood with respect to σ and equate to zero:
which is solved by
Inserting we obtain
To calculate its expected value, it is convenient to rewrite the expression in terms of zeromean random variables (statistical error) . Expressing the estimate in these variables yields
Simplifying the expression above, utilizing the facts that and , allows us to obtain
This means that the estimator is biased. However, is consistent.
Formally we say that the maximum likelihood estimator for θ = (μ,σ^{2}) is:
In this case the MLEs could be obtained individually. In general this may not be the case, and the MLEs would have to be obtained simultaneously.
It may be the case that variables are correlated, that is, not independent. Two random variables X and Y are independent only if their joint probability density function is the product of the individual probability density functions, i.e.
Suppose one constructs an ordern Gaussian vector out of random variables , where each variable has means given by . Furthermore, let the covariance matrix be denoted by Σ,
The joint probability density function of these n random variables is then given by:
In the two variable case, the joint probability density function is given by:
In this and other cases where a joint density function exists, the likelihood function is defined as above, under Principles, using this density.
Maximum likelihood estimation is used for a wide range of statistical models, including:
These uses arise across applications in widespead set of fields, including:

