Maximum likelihood estimation
In statistics, maximum likelihood estimation (MLE) is a method of estimating the parameters of a statistical model so the observed data is most probable. Specifically, this is done by finding the value of the parameter (or parameter vector) θ{displaystyle theta } that maximizes the likelihood function L(θ;y){displaystyle {mathcal {L}}(theta ;mathbf {y} )}, which is the joint probability of the observed data y{displaystyle mathbf {y} }, over a parameter space Θ{displaystyle Theta }. The point θ^∈Θ{displaystyle {widehat {theta ,}}in Theta } 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 inference within much of the quantitative research of the social and medical sciences.[2][3]
As an example, suppose that we are interested in the heights of adult female penguins, but are unable to measure the height of every penguin in a population (due to cost or time constraints). Assuming that the heights are normally distributed with some unknown mean and variance, the mean and variance can be estimated with MLE while only knowing the heights of some sample of the overall population. MLE would accomplish that by taking the mean and variance as parameters and finding particular parametric values that make the observed results the most probable given the normal model.
If the likelihood function is differentiable with respect to θ{displaystyle theta }, the derivative test for determining maxima can be applied. In some cases, the first-order conditions of the likelihood function can be solved explicitly; for instance, the ordinary least squares estimator maximizes the likelihood of the linear regression model.[4] Under most circumstances, however, numerical methods will be necessary to find the maximum of the likelihood function.
From the point of view of Bayesian inference, MLE is a special case of maximum a posteriori estimation (MAP) that assumes a uniform prior distribution of the parameters. In frequentist inference, MLE is one of several methods to get estimates of parameters without using prior distributions. Priors are avoided by not making probability statements about the parameters, but only about their estimates, whose properties are fully defined by the observations and the statistical model.
Contents
1 Principles
2 Properties
2.1 Consistency
2.2 Functional invariance
2.3 Higher-order properties
3 Relation to Bayesian inference
4 Examples
4.1 Discrete uniform distribution
4.2 Discrete distribution, finite parameter space
4.3 Flow
4.4 Discrete distribution, continuous parameter space
4.5 Continuous distribution, continuous parameter space
5 Non-independent variables
6 Iterative procedures
7 History
8 See also
8.1 Other estimation methods
8.2 Related concepts
9 Notes
10 References: non-historical
11 References: historical
12 Further reading
13 External links
Principles
The method of maximum likelihood is based on the likelihood function, L(θ;x){displaystyle {mathcal {L}}(theta ,;x)}. We are given a statistical model, i.e. a family of distributions {f(⋅;θ)∣θ∈Θ}{displaystyle {f(cdot ,;theta )mid theta in Theta }}, where θ{displaystyle theta } denotes the (possibly multi-dimensional) parameter for the model. The method of maximum likelihood finds the values of the model parameter, θ{displaystyle theta }, that maximize the likelihood function, L(θ;x){displaystyle {mathcal {L}}(theta ,;x)}. Intuitively, this selects the parameter values that make the data most probable.
The method defines a maximum likelihood estimate:
- θ^∈{argmaxθ∈Θ L(θ;x)},{displaystyle {widehat {theta ,}}in {{underset {theta in Theta }{operatorname {arg,max} }} {mathcal {L}}(theta ,;x)},}
if a maximum exists.
In practice, it is often convenient to work with the natural logarithm of the likelihood function, called the log-likelihood:
- ℓ(θ;x)=lnL(θ;x),{displaystyle ell (theta ,;x)=ln {mathcal {L}}(theta ,;x),}
or the average log-likelihood:
- ℓ^(θ;x)=1nlnL(θ;x).{displaystyle {widehat {ell ,}}(theta ,;x)={frac {1}{n}}ln {mathcal {L(theta ,;x)}}.}
The hat over ℓ{displaystyle ell } indicates that it is akin to an estimator. Indeed, ℓ^{displaystyle {widehat {ell ,}}} estimates the expected log-likelihood of a single observation in the model.
An MLE is the same regardless of whether we maximize the likelihood or the log-likelihood, because log is strictly increasing.
For many models, a maximum likelihood estimator can be found as an explicit function of the observed data x{displaystyle x}. For many other models, however, no closed-form solution to the maximization problem is known or available, and an MLE can only be found via numerical global optimization. For some problems, there may be multiple values that maximize the likelihood. For other problems, no maximum likelihood estimate exists: either the log-likelihood function increases without ever reaching a supremum value, or the supremum does exist but is outside the bounds of Θ{displaystyle Theta }, the set of acceptable parameter values.
Properties
A maximum likelihood estimator is an extremum estimator obtained by maximizing, as a function of θ, the objective function (cf. loss function) ℓ^(θ;x){displaystyle {widehat {ell ,}}(theta ,;x)}. If the data are independent and identically distributed, then we have
- ℓ^(θ;x)=1n∑i=1nlnf(xi∣θ),{displaystyle {widehat {ell ,}}(theta ,;x)={frac {1}{n}}sum _{i=1}^{n}ln f(x_{i}mid theta ),}
this being the sample analogue of the expected log-likelihood ℓ(θ)=E[lnf(xi∣θ)]{displaystyle ell (theta )=operatorname {E} [,ln f(x_{i}mid theta ),]}, 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.[5] 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.
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).- 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 f(⋅;θ0){displaystyle f(cdot ,;theta _{0})} 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 θ^{displaystyle {widehat {theta ,}}} converges in probability to its true value:
- θ^mle →p θ0.{displaystyle {widehat {theta ,}}_{mathrm {mle} } {xrightarrow {text{p}}} theta _{0}.}
Under slightly stronger conditions, the estimator converges almost surely (or strongly):
- θ^mle →a.s. θ0.{displaystyle {widehat {theta ,}}_{mathrm {mle} } {xrightarrow {text{a.s.}}} theta _{0}.}
Note that, in practical applications, data is never generated by f(⋅;θ0){displaystyle f(cdot ,;theta _{0})}. Rather, f(⋅;θ0){displaystyle f(cdot ,;theta _{0})} is a model, often in idealized form, of the process that generated 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.[6]
Identification of the model:
- θ≠θ0⇔f(⋅∣θ)≠f(⋅∣θ0).{displaystyle theta neq theta _{0}quad Leftrightarrow quad f(cdot mid theta )neq f(cdot mid theta _{0}).}
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.
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.
Continuity: the function ln f(x|θ) is continuous in θ for almost all values of x:
- P[lnf(x∣θ)∈C0(Θ)]=1.{displaystyle operatorname {P} !{big [};ln f(xmid theta );in ;mathbb {C} ^{0}(Theta );{big ]}=1.}
The continuity here can be replaced with a slightly weaker condition of upper semi-continuity.
Dominance: there exists D(x) integrable with respect to the distribution f(x|θ0) such that
- |lnf(x∣θ)|<D(x) for all θ∈Θ.{displaystyle {big |}ln f(xmid theta ){big |}<D(x)quad {text{ for all }}theta in Theta .}
By the uniform law of large numbers, the dominance condition together with continuity establish the uniform convergence in probability of the log-likelihood:
- supθ∈Θ|ℓ^(θ∣x)−ℓ(θ)| →p 0.{displaystyle sup _{theta in Theta }{big |}{widehat {ell ,}}(theta mid x)-ell (theta ),{big |} {xrightarrow {text{p}}} 0.}
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 ℓ^(θ∣x){displaystyle {widehat {ell ,}}(theta mid x)} is stochastically equicontinuous.
If one wants to demonstrate that the ML estimator θ^{displaystyle {widehat {theta ,}}} converges to θ0almost surely, then a stronger condition of uniform convergence almost surely has to be imposed:
- supθ∈Θ‖ℓ^(x∣θ)−ℓ(θ)‖ →a.s. 0.{displaystyle sup _{theta in Theta }{big |};{widehat {ell ,}}(xmid theta )-ell (theta );{big |} {xrightarrow {text{a.s.}}} 0.}
Additionally, if (as assumed above) the data were generated by f(⋅;θ0){displaystyle f(cdot ,;theta _{0})}, then under certain conditions, it can also be shown that the maximum likelihood estimator converges in distribution to a normal distribution. Specifically,[7]
- n(θ^mle−θ0) →d N(0,I−1){displaystyle {sqrt {n}}{big (}{widehat {theta ,}}_{mathrm {mle} }-theta _{0}{big )} {xrightarrow {d}} {mathcal {N}}(0,,I^{-1})}
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 θ^{displaystyle {widehat {theta ,}}} is the MLE for θ{displaystyle theta }, and if g(θ){displaystyle g(theta )} is any transformation of θ{displaystyle theta }, then the MLE for α=g(θ){displaystyle alpha =g(theta )} is by definition
- α^=g(θ^).{displaystyle {widehat {alpha }}=g(,{widehat {theta ,}},).,}
It maximizes the so-called profile likelihood:
- L¯(α)=supθ:α=g(θ)L(θ).{displaystyle {bar {L}}(alpha )=sup _{theta :alpha =g(theta )}L(theta ).,}
The MLE is also invariant with respect to certain transformations of the data. If y=g(x){displaystyle y=g(x)} where g{displaystyle g} is one to one and does not depend on the parameters to be estimated, then the density functions satisfy
- fY(y)=fX(x)|g′(x)|{displaystyle f_{Y}(y)={frac {f_{X}(x)}{|g'(x)|}}}
and hence the likelihood functions for X{displaystyle X} and Y{displaystyle Y} 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.
Higher-order properties
As noted above, the maximum likelihood estimator is √n -consistent and asymptotically efficient, meaning that it reaches the Cramér–Rao bound:
- n(θ^mle−θ0) →d N(0, I−1),{displaystyle {sqrt {n}}({widehat {theta ,}}_{text{mle}}-theta _{0}) {xrightarrow {d}} {mathcal {N}}(0, I^{-1}),}
where I{displaystyle I} is the Fisher information matrix:
- Ijk=EX[−∂2lnfθ0(Xt)∂θj∂θk].{displaystyle I_{jk}=operatorname {E} _{X}{bigg [};{-{frac {partial ^{2}ln f_{theta _{0}}(X_{t})}{partial theta _{j},partial theta _{k}}}};{bigg ]}.}
In particular, it means that the bias of the maximum likelihood estimator is equal to zero up to the order 1⁄√n . 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 1⁄n. This bias is equal to (componentwise)[8]
- bh≡E[(θ^mle−θ0)h]=1n∑i,j,k=1nIhiIjk(12Kijk+Jj,ik){displaystyle b_{h}equiv operatorname {E} {bigg [};({widehat {theta }}_{mathrm {mle} }-theta _{0})_{h};{bigg ]}={frac {1}{n}}sum _{i,j,k=1}^{n}I^{hi}I^{jk}{big (}{frac {1}{2}}K_{ijk}+J_{j,ik}{big )}}
where Ijk{displaystyle I^{jk}} denotes the (j,k)-th component of the inverse Fisher information matrix I−1{displaystyle I^{-1}}, and
- 12Kijk+Jj,ik=EX[12∂3lnfθ0(Xt)∂θi∂θj∂θk+∂lnfθ0(Xt)∂θj∂2lnfθ0(Xt)∂θi∂θk].{displaystyle {tfrac {1}{2}}K_{ijk}+J_{j,ik}=operatorname {E} _{X}{bigg [};{frac {1}{2}}{frac {partial ^{3}ln f_{theta _{0}}(X_{t})}{partial theta _{i},partial theta _{j},partial theta _{k}}}+{frac {partial ln f_{theta _{0}}(X_{t})}{partial theta _{j}}}{frac {partial ^{2}ln f_{theta _{0}}(X_{t})}{partial theta _{i},partial theta _{k}}};{bigg ]}.}
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:
- θ^mle∗=θ^mle−b^.{displaystyle {widehat {theta ,}}_{text{mle}}^{*}={widehat {theta ,}}_{text{mle}}-{widehat {b,}}.}
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, as was shown by Kano (1996), the maximum likelihood estimator is not third-order efficient.
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:
- P(θ∣x1,x2,…,xn)=f(x1,x2,…,xn∣θ)P(θ)P(x1,x2,…,xn){displaystyle operatorname {P} (theta mid x_{1},x_{2},ldots ,x_{n})={frac {f(x_{1},x_{2},ldots ,x_{n}mid theta )operatorname {P} (theta )}{operatorname {P} (x_{1},x_{2},ldots ,x_{n})}}}
where P(θ){displaystyle P(theta )} is the prior distribution for the parameter θ and where P(x1,x2,…,xn){displaystyle operatorname {P} (x_{1},x_{2},ldots ,x_{n})} is the probability of the data averaged over all parameters. Since the denominator is independent of θ, the Bayesian estimator is obtained by maximizing f(x1,x2,…,xn∣θ)P(θ){displaystyle f(x_{1},x_{2},ldots ,x_{n}mid theta )operatorname {P} (theta )} with respect to θ. If we further assume that the prior P(θ){displaystyle P(theta )} is a uniform distribution, the Bayesian estimator is obtained by maximizing the likelihood function f(x1,x2,…,xn∣θ){displaystyle f(x_{1},x_{2},ldots ,x_{n}mid theta )}. Thus the Bayesian estimator coincides with the maximum likelihood estimator for a uniform prior distribution P(θ){displaystyle operatorname {P} (theta )}.
Examples
Discrete uniform distribution
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 maximum likelihood estimator n^{displaystyle {widehat {n}}} 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 n^{displaystyle {widehat {n}}}, is (n + 1)/2. As a result, with a sample size of 1, the maximum likelihood estimator for n will systematically underestimate n by (n − 1)/2.
Discrete distribution, finite parameter space
Suppose one wishes to determine just how biased an unfair coin is. Call the probability of tossing a ‘head’ p. The goal then becomes to determine p.
Suppose the coin is tossed 80 times: i.e. the sample might be something like x1 = H, x2 = T, ..., x80 = T, and the count of the number of heads "H" is observed.
The probability of tossing tails is 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 for different values of p (the "probability of success"), the likelihood function (defined below) takes one of three values:
- P[H=49∣p=13]=(8049)(13)49(1−13)31≈0.000,P[H=49∣p=12]=(8049)(12)49(1−12)31≈0.012,P[H=49∣p=23]=(8049)(23)49(1−23)31≈0.054.{displaystyle {begin{aligned}operatorname {P} {big [};mathrm {H} =49mid p={tfrac {1}{3}};{big ]}&={binom {80}{49}}({tfrac {1}{3}})^{49}(1-{tfrac {1}{3}})^{31}approx 0.000,\[6pt]operatorname {P} {big [};mathrm {H} =49mid p={tfrac {1}{2}};{big ]}&={binom {80}{49}}({tfrac {1}{2}})^{49}(1-{tfrac {1}{2}})^{31}approx 0.012,\[6pt]operatorname {P} {big [};mathrm {H} =49mid p={tfrac {2}{3}};{big ]}&={binom {80}{49}}({tfrac {2}{3}})^{49}(1-{tfrac {2}{3}})^{31}approx 0.054.end{aligned}}}
The likelihood is maximized when p = 2⁄3, and so this is the maximum likelihood estimate for p.
Flow
Assume that we have observations of ai the time a person enters the state of interest, some observables xi, and the censoring of the flow data takes on a particular form. In particular ti=min(tiU,L){displaystyle t_{i}=min(t_{i}^{U},L)}, where ti is the observed duration outcome, tiU{displaystyle t_{i}^{U}} is the underlying continuous variable and L is the censoring threshold.[9] For instance, when thinking about unemployment spells, ai is the data of entering unemployment, xi is a vector of worker characteristics, and ti is the observed unemployment duration. If we only follow the workers for a certain period of time, this variable is necessarily a censored version of the true unemployment duration.
Two key assumptions allow for setting up the loglikelihood. First, a distributional form for the latent variable tiU{displaystyle t_{i}^{U}} needs to be assumed. Second, independence between the true duration and the starting point of the spell is assumed, i.e.,
- F(tiU∨xi,ai,L)=F(tiU∨xi){displaystyle F(t_{i}^{U}lor x_{i},a_{i},L)=F(t_{i}^{U}lor x_{i})}
where F is the conditional distribution of the underlying duration variable.[10] This latter assumption allows us to model the probability that the variable is censored, i.e.,
- Pr(tiU≥L∨xi)=1−F(L∨xi){displaystyle Pr(t_{i}^{U}geq Llor x_{i})=1-F(Llor x_{i})}
which leads to the following log likelihood:
- ∑i=1n[dilog(f(ti∨xi))+(1−di)log(1−F(L∨xi))]{displaystyle sum _{i=1}^{n}[d_{i}log(f(t_{i}lor x_{i}))+(1-d_{i})log(1-F(Llor x_{i}))]}
where f is the density associated with the distribution F and di is an indicator denoting whether ti = L.[11] Additionally, it is possible to have the threshold vary at the observational level, by replacing L by Li in the formulas above.[12]
Tests of specification in duration models encompass testing for the validity of the imposed functional form. Tests of restrictions on the functional form are similar to those testing for unobserved heterogeneity, where the restriction imposes no such heterogeneity. Nevertheless, it is often desirable to test for such heterogeneity, as this can bias the estimation of the hazard rate.[13] Similarly, tests for censoring exist that compare the distribution of the generalized error under the censored and the uncensored assumption.[14]
Discrete distribution, continuous parameter space
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
- L(p)=fD(H=49∣p)=(8049)p49(1−p)31,{displaystyle L(p)=f_{D}(mathrm {H} =49mid p)={binom {80}{49}}p^{49}(1-p)^{31},}
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:
- 0=∂∂p((8049)p49(1−p)31),0=49p48(1−p)31−31p49(1−p)30=p48(1−p)30[49(1−p)−31p]=p48(1−p)30[49−80p]{displaystyle {begin{aligned}{0}&{}={frac {partial }{partial p}}left({binom {80}{49}}p^{49}(1-p)^{31}right),\[8pt]{0}&{}=49p^{48}(1-p)^{31}-31p^{49}(1-p)^{30}\[8pt]&{}=p^{48}(1-p)^{30}left[49(1-p)-31pright]\[8pt]&{}=p^{48}(1-p)^{30}left[49-80pright]end{aligned}}}
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 s 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 s⁄n which is the maximum likelihood estimator for any sequence of n Bernoulli trials resulting in s 'successes'.
Continuous distribution, continuous parameter space
For the normal distribution N(μ,σ2){displaystyle {mathcal {N}}(mu ,sigma ^{2})} which has probability density function
- f(x∣μ,σ2)=12πσ2 exp(−(x−μ)22σ2),{displaystyle f(xmid mu ,sigma ^{2})={frac {1}{{sqrt {2pi sigma ^{2}}} }}exp {left(-{frac {(x-mu )^{2}}{2sigma ^{2}}}right)},}
the corresponding probability density function for a sample of n independent identically distributed normal random variables (the likelihood) is
- f(x1,…,xn∣μ,σ2)=∏i=1nf(xi∣μ,σ2)=(12πσ2)n/2exp(−∑i=1n(xi−μ)22σ2),{displaystyle f(x_{1},ldots ,x_{n}mid mu ,sigma ^{2})=prod _{i=1}^{n}f(x_{i}mid mu ,sigma ^{2})=left({frac {1}{2pi sigma ^{2}}}right)^{n/2}exp left(-{frac {sum _{i=1}^{n}(x_{i}-mu )^{2}}{2sigma ^{2}}}right),}
or more conveniently,
- f(x1,…,xn∣μ,σ2)=(12πσ2)n/2exp(−∑i=1n(xi−x¯)2+n(x¯−μ)22σ2),{displaystyle f(x_{1},ldots ,x_{n}mid mu ,sigma ^{2})=left({frac {1}{2pi sigma ^{2}}}right)^{n/2}exp left(-{frac {sum _{i=1}^{n}(x_{i}-{bar {x}})^{2}+n({bar {x}}-mu )^{2}}{2sigma ^{2}}}right),}
where x¯{displaystyle {bar {x}}} is the sample mean.
This family of distributions has two parameters: θ = (μ, σ); so we maximize the likelihood, L(μ,σ)=f(x1,…,xn∣μ,σ){displaystyle {mathcal {L}}(mu ,sigma )=f(x_{1},ldots ,x_{n}mid mu ,sigma )}, over both parameters simultaneously, or if possible, individually.
Since the logarithm function itself is a continuous strictly increasing function over the range of the likelihood, the values which maximize the likelihood will also maximize its logarithm (the log-likelihood itself is not necessarily strictly increasing). The log-likelihood can be written as follows:
- log(L(μ,σ))=−n2log(2πσ2)−12σ2∑i=1n(xi−μ)2{displaystyle log {Big (}{mathcal {L}}(mu ,sigma ){Big )}=-{frac {,n,}{2}}log(2pi sigma ^{2})-{frac {1}{2sigma ^{2}}}sum _{i=1}^{n}(,x_{i}-mu ,)^{2}}
(Note: the log-likelihood is closely related to information entropy and Fisher information.)
We now compute the derivatives of this log-likelihood as follows.
- 0=∂∂μlog(L(μ,σ))=0−−2n(x¯−μ)2σ2.{displaystyle {begin{aligned}0&={frac {partial }{partial mu }}log {Big (}{mathcal {L}}(mu ,sigma ){Big )}=0-{frac {;-2!n({bar {x}}-mu );}{2sigma ^{2}}}.end{aligned}}}
This is solved by
- μ^=x¯=∑i=1nxin.{displaystyle {widehat {mu }}={bar {x}}=sum _{i=1}^{n}{frac {,x_{i},}{n}}.}
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 expected value is equal to the parameter μ of the given distribution,
- E[μ^]=μ,{displaystyle operatorname {E} {big [};{widehat {mu }};{big ]}=mu ,,}
which means that the maximum likelihood estimator μ^{displaystyle {widehat {mu }}} is unbiased.
Similarly we differentiate the log-likelihood with respect to σ and equate to zero:
- 0=∂∂σlog[(12πσ2)n/2exp(−∑i=1n(xi−x¯)2+n(x¯−μ)22σ2)]=∂∂σ[n2log(12πσ2)−∑i=1n(xi−x¯)2+n(x¯−μ)22σ2]=−nσ+∑i=1n(xi−x¯)2+n(x¯−μ)2σ3{displaystyle {begin{aligned}0&={frac {partial }{partial sigma }}log {Bigg [}left({frac {1}{2pi sigma ^{2}}}right)^{n/2}exp left(-{frac {sum _{i=1}^{n}(x_{i}-{bar {x}})^{2}+n({bar {x}}-mu )^{2}}{2sigma ^{2}}}right){Bigg ]}\[6pt]&={frac {partial }{partial sigma }}left[{frac {n}{2}}log left({frac {1}{2pi sigma ^{2}}}right)-{frac {sum _{i=1}^{n}(x_{i}-{bar {x}})^{2}+n({bar {x}}-mu )^{2}}{2sigma ^{2}}}right]\[6pt]&=-{frac {,n,}{sigma }}+{frac {sum _{i=1}^{n}(x_{i}-{bar {x}})^{2}+n({bar {x}}-mu )^{2}}{sigma ^{3}}}end{aligned}}}
which is solved by
- σ^2=1n∑i=1n(xi−μ)2.{displaystyle {widehat {sigma }}^{2}={frac {1}{n}}sum _{i=1}^{n}(x_{i}-mu )^{2}.}
Inserting the estimate μ=μ^{displaystyle mu ={widehat {mu }}} we obtain
- σ^2=1n∑i=1n(xi−x¯)2=1n∑i=1nxi2−1n2∑i=1n∑j=1nxixj.{displaystyle {widehat {sigma }}^{2}={frac {1}{n}}sum _{i=1}^{n}(x_{i}-{bar {x}})^{2}={frac {1}{n}}sum _{i=1}^{n}x_{i}^{2}-{frac {1}{n^{2}}}sum _{i=1}^{n}sum _{j=1}^{n}x_{i}x_{j}.}
To calculate its expected value, it is convenient to rewrite the expression in terms of zero-mean random variables (statistical error) δi≡μ−xi{displaystyle delta _{i}equiv mu -x_{i}}. Expressing the estimate in these variables yields
- σ^2=1n∑i=1n(μ−δi)2−1n2∑i=1n∑j=1n(μ−δi)(μ−δj).{displaystyle {widehat {sigma }}^{2}={frac {1}{n}}sum _{i=1}^{n}(mu -delta _{i})^{2}-{frac {1}{n^{2}}}sum _{i=1}^{n}sum _{j=1}^{n}(mu -delta _{i})(mu -delta _{j}).}
Simplifying the expression above, utilizing the facts that E[δi]=0{displaystyle operatorname {E} {big [};delta _{i};{big ]}=0} and E[δi2]=σ2{displaystyle operatorname {E} {big [};delta _{i}^{2};{big ]}=sigma ^{2}}, allows us to obtain
- E[σ^2]=n−1nσ2.{displaystyle operatorname {E} {big [};{widehat {sigma }}^{2};{big ]}={frac {,n-1,}{n}}sigma ^{2}.}
This means that the estimator σ^{displaystyle {widehat {sigma }}} is biased. However, σ^{displaystyle {widehat {sigma }}} is consistent.
Formally we say that the maximum likelihood estimator for θ=(μ,σ2){displaystyle theta =(mu ,sigma ^{2})} is
- θ^=(μ^,σ^2).{displaystyle {widehat {theta ,}}=left({widehat {mu }},{widehat {sigma }}^{2}right).}
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.
The normal log-likelihood at its maximum takes a particularly simple form:
- log(L(μ^,σ^))=−n2(log(2πσ^2)+1){displaystyle log {Big (}{mathcal {L}}({widehat {mu }},{widehat {sigma }}){Big )}={frac {,-n;;}{2}}{big (},log(2pi {widehat {sigma }}^{2})+1,{big )}}
This maximum log-likelihood can be shown to be the same for more general least squares, even for non-linear least squares. This is often used in determining likelihood-based approximate confidence intervals and confidence regions, which are generally more accurate than those using the asymptotic normality discussed above.
Non-independent variables
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.
- f(x,y)=f(x)f(y){displaystyle f(x,y)=f(x)f(y),}
Suppose one constructs an order-n Gaussian vector out of random variables (x1,…,xn){displaystyle (x_{1},ldots ,x_{n})}, where each variable has means given by (μ1,…,μn){displaystyle (mu _{1},ldots ,mu _{n})}. Furthermore, let the covariance matrix be denoted by Σ{displaystyle {mathit {Sigma }}}.
The joint probability density function of these n random variables is then given by:
- f(x1,…,xn)=1(2π)n/2det(Σ)exp(−12[x1−μ1,…,xn−μn]Σ−1[x1−μ1,…,xn−μn]T){displaystyle f(x_{1},ldots ,x_{n})={frac {1}{(2pi )^{n/2}{sqrt {{text{det}}({mathit {Sigma }})}}}}exp left(-{frac {1}{2}}left[x_{1}-mu _{1},ldots ,x_{n}-mu _{n}right]{mathit {Sigma }}^{-1}left[x_{1}-mu _{1},ldots ,x_{n}-mu _{n}right]^{mathrm {T} }right)}
In the two variable case, the joint probability density function is given by:
- f(x,y)=12πσxσy1−ρ2exp[−12(1−ρ2)((x−μx)2σx2−2ρ(x−μx)(y−μy)σxσy+(y−μy)2σy2)]{displaystyle f(x,y)={frac {1}{2pi sigma _{x}sigma _{y}{sqrt {1-rho ^{2}}}}}exp left[-{frac {1}{2(1-rho ^{2})}}left({frac {(x-mu _{x})^{2}}{sigma _{x}^{2}}}-{frac {2rho (x-mu _{x})(y-mu _{y})}{sigma _{x}sigma _{y}}}+{frac {(y-mu _{y})^{2}}{sigma _{y}^{2}}}right)right]}
In this and other cases where a joint density function exists, the likelihood function is defined as above, in the section Principles, using this density.
Iterative procedures
Consider problems where both states xi{displaystyle x_{i}} and parameters such as σ2{displaystyle sigma ^{2}} require to be estimated. Iterative procedures such as Expectation-maximization algorithms may be used to solve joint state-parameter estimation problems.
For example, suppose that a sample consisting of n observations of state estimates x^i{displaystyle {widehat {x}}_{i}} together with a sample mean x¯{displaystyle {bar {x}}} have been calculated by either a minimum-variance Kalman filter or a minimum-variance smoother using a previous variance estimate σ^2{displaystyle {widehat {sigma }}^{2}}. Then the next variance iterate may be obtained from the maximum likelihood estimate calculation
- σ^2=1n∑i=1n(x^i−x¯)2.{displaystyle {widehat {sigma }}^{2}={frac {1}{n}}sum _{i=1}^{n}({widehat {x}}_{i}-{bar {x}})^{2}.}
The convergence of MLEs within filtering and smoothing EM algorithms has been studied in the literature.[15][16]
History
Early users of maximum likelihood were Carl Friedrich Gauss, Pierre-Simon Laplace, Thorvald N. Thiele, and Francis Ysidro Edgeworth.[17]
However its widespread use arose between 1912 and 1922 when Ronald Fisher recommended, widely popularized, and carefully analyzed maximum-likelihood estimation (with fruitless attempts at proofs).[18]
Maximum-likelihood estimation finally transcended heuristic justification in a proof published by Samuel S. Wilks in 1938, now called Wilks' theorem.[19] The theorem shows that the error in the logarithm of likelihood values for estimates from multiple independent observations is asymptotically χ 2-distributed, which enables convenient determination of a confidence region around any one estimate of the parameters. The only difficult part of Wilks’ proof depends on the expected value of the Fisher information matrix, which ironically is provided by a theorem proven by Fisher.[20] Wilks continued to improve on the generality of the theorem throughout his life, with his most general proof published in 1962.[21]
Some of the theory behind maximum likelihood estimation was developed for Bayesian statistics.[18]
Reviews of the development of maximum likelihood estimation have been provided by a number of authors.[22]
See also
Other estimation methods
Generalized method of moments are methods related to the likelihood equation in maximum likelihood estimation
M-estimator, an approach used in robust statistics
Maximum a posteriori (MAP) estimator, for a contrast in the way to calculate estimators when prior knowledge is postulated
Maximum spacing estimation, a related method that is more robust in many situations- Maximum entropy estimation
Method of moments (statistics), another popular method for finding parameters of distributions
Method of support, a variation of the maximum likelihood technique- Minimum distance estimation
- Partial likelihood methods for panel data
Quasi-maximum likelihood estimator, an MLE estimator that is misspecified, but still consistent
Restricted maximum likelihood, a variation using a likelihood function calculated from a transformed set of data
Related concepts
Akaike information criterion, a criterion to compare statistical models, based on MLE
Extremum estimator, a more general class of estimators to which MLE belongs
Fisher information, information matrix, its relationship to covariance matrix of ML estimates
Mean squared error, a measure of how 'good' an estimator of a distributional parameter is (be it the maximum likelihood estimator or some other estimator)
RANSAC, a method to estimate parameters of a mathematical model given data that contains outliers
Rao–Blackwell theorem, which yields a process for finding the best possible unbiased estimator (in the sense of having minimal mean squared error); the MLE is often a good starting place for the process
Wilks’ theorem provides a means of estimating the size and shape of the region of roughly equally-probable estimates for the population's parameter values, using the information from a single sample, using a chi-squared distribution
Notes
^ Rossi, Richard J. (2018). Mathematical Statistics : An Introduction to Likelihood Based Inference. New York: John Wiley & Sons. p. 227. ISBN 978-1-118-77104-4..mw-parser-output cite.citation{font-style:inherit}.mw-parser-output .citation q{quotes:"""""""'""'"}.mw-parser-output .citation .cs1-lock-free a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/6/65/Lock-green.svg/9px-Lock-green.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .citation .cs1-lock-limited a,.mw-parser-output .citation .cs1-lock-registration a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/d/d6/Lock-gray-alt-2.svg/9px-Lock-gray-alt-2.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .citation .cs1-lock-subscription a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/a/aa/Lock-red-alt-2.svg/9px-Lock-red-alt-2.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registration{color:#555}.mw-parser-output .cs1-subscription span,.mw-parser-output .cs1-registration span{border-bottom:1px dotted;cursor:help}.mw-parser-output .cs1-ws-icon a{background:url("//upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Wikisource-logo.svg/12px-Wikisource-logo.svg.png")no-repeat;background-position:right .1em center}.mw-parser-output code.cs1-code{color:inherit;background:inherit;border:inherit;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;font-size:100%}.mw-parser-output .cs1-visible-error{font-size:100%}.mw-parser-output .cs1-maint{display:none;color:#33aa33;margin-left:0.3em}.mw-parser-output .cs1-subscription,.mw-parser-output .cs1-registration,.mw-parser-output .cs1-format{font-size:95%}.mw-parser-output .cs1-kern-left,.mw-parser-output .cs1-kern-wl-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right,.mw-parser-output .cs1-kern-wl-right{padding-right:0.2em}
^ Pickles, Andrew (1985). An Introduction to Likelihood Analysis. Norwich: W. H. Hutchins & Sons. p. 3. ISBN 0-86094-190-6.
^ King, Gary (1989). Unifying Political Methodology : The Likelihood Theory of Statistical Inference. Cambridge: Cambridge University Press. ISBN 0-521-36622-4.
^ Press, W. H.; Flannery, B. P.; Teukolsky, S. A.; Vetterling, W. T. (1992). "Least Squares as a Maximum Likelihood Estimator". Numerical Recipes in FORTRAN: The Art of Scientific Computing (2nd ed.). Cambridge: Cambridge University Press. pp. 651–655. ISBN 0-521-43064-X.
^ Pfanzagl (1994, p. 206)
^ Newey & McFadden (1994, Theorem 2.5.)
^ Newey & McFadden (1994, Theorem 3.3.)
^ Cox & Snell (1968, formula (20))
^ Wooldridge, J. (2002): Econometric Analysis of Cross Section and Panel Data, MIT Press, Cambridge, Massachusetts
^ Wooldridge, J. (2002): Econometric Analysis of Cross Section and Panel Data, MIT Press, Cambridge, Massachusetts
^ Hayashi, F. (2000): Econometrics. Princeton University Press, New Jersey.
^ Wooldridge, J. (2002): Econometric Analysis of Cross Section and Panel Data, MIT Press, Cambridge, Massachusetts
^ Cameron A. C. and P. K. Trivedi (2005): Microeconometrics: Methods and Applications. Cambridge University Press, New York.
^ Jaggia, S. and P. K. Trivedi (1994): Joint and Separate Score Test for Heterogeneity in a Censored Exponential Model. Review of Economics and Statistics, 79, pp. 340–343.
^ Einicke, G. A.; Falco, G.; Malos, J. T. (May 2010). "EM Algorithm State Matrix Estimation for Navigation". IEEE Signal Processing Letters. 17 (5): 437–440. doi:10.1109/LSP.2010.2043151.
^ Einicke, G. A.; Falco, G.; Dunn, M. T.; Reid, D. C. (May 2012). "Iterative Smoother-Based Variance Estimation". IEEE Signal Processing Letters. 19 (5): 275–278. doi:10.1109/LSP.2012.2190278.
^ Edgeworth & September 1908 and Edgeworth & December 1908
^ ab Pfanzagl, Johann, with the assistance of R. Hamböker (1994). Parametric Statistical Theory. Walter de Gruyter. pp. 207–208. ISBN 978-3-11-013863-4.CS1 maint: Multiple names: authors list (link)
^ Wilks (1938)
^ Owen, Art B. (2001). Empirical Likelihood. London: Chapman & Hall/Boca Raton, FL: CRC Press.
ISBN 978-1584880714.
^ Wilks, Samuel S. (1962), Mathematical Statistics, New York: John Wiley & Sons.
ISBN 978-0471946502.
^ Savage (1976), Pratt (1976), Stigler (1978, 1986, 1999), Hald (1998, 1999), and Aldrich (1997)
References: non-historical
.mw-parser-output .refbegin{font-size:90%;margin-bottom:0.5em}.mw-parser-output .refbegin-hanging-indents>ul{list-style-type:none;margin-left:0}.mw-parser-output .refbegin-hanging-indents>ul>li,.mw-parser-output .refbegin-hanging-indents>dl>dd{margin-left:0;padding-left:3.2em;text-indent:-3.2em;list-style:none}.mw-parser-output .refbegin-100{font-size:100%}
Cox, David R.; Snell, E. Joyce (1968). "A general definition of residuals". Journal of the Royal Statistical Society, Series B. 30 (2): 248–275. JSTOR 2984505.
Kano, Yutaka (1996). "Third-order efficiency implies fourth-order efficiency". Journal of the Japan Statistical Society. 26: 101–117. doi:10.14490/jjss1995.26.101.
[permanent dead link]
Newey, Whitney K.; McFadden, Daniel (1994). "Chapter 36: Large sample estimation and hypothesis testing". In Engle, Robert; McFadden, Dan. Handbook of Econometrics, Vol.4. Elsevier Science. pp. 2111–2245. ISBN 978-0-444-88766-5.
Fisher, Roland (1930). "Inverse Probability". Mathematical Proceedings of the Cambridge Philosophical Society. 26 (4): 528–535. doi:10.1017/S0305004100016297.
References: historical
Aldrich, John (1997). "R. A. Fisher and the making of maximum likelihood 1912–1922". Statistical Science. 12 (3): 162–176. doi:10.1214/ss/1030037906. MR 1617519.
Edgeworth, Francis Y. (Sep 1908). "On the probable errors of frequency-constants". Journal of the Royal Statistical Society. 71 (3): 499–512. doi:10.2307/2339293. JSTOR 2339293.
Edgeworth, Francis Y. (Dec 1908). "On the probable errors of frequency-constants". Journal of the Royal Statistical Society. 71 (4): 651–678. doi:10.2307/2339378. JSTOR 2339378.
Hald, Anders (1998). A history of mathematical statistics from 1750 to 1930. New York, NY: Wiley. ISBN 978-0-471-17912-2.
Hald, Anders (1999). "On the history of maximum likelihood in relation to inverse probability and least squares". Statistical Science. 14 (2): 214–222. doi:10.1214/ss/1009212248. JSTOR 2676741.
Pratt, John W. (1976). "F. Y. Edgeworth and R. A. Fisher on the efficiency of maximum likelihood estimation". The Annals of Statistics. 4 (3): 501–514. doi:10.1214/aos/1176343457. JSTOR 2958222.
Savage, Leonard J. (1976). "On rereading R. A. Fisher". The Annals of Statistics. 4 (3): 441–500. doi:10.1214/aos/1176343456. JSTOR 2958221.
Stigler, Stephen M. (1978). "Francis Ysidro Edgeworth, statistician". Journal of the Royal Statistical Society, Series A. 141 (3): 287–322. doi:10.2307/2344804. JSTOR 2344804.
Stigler, Stephen M. (1986). The history of statistics: the measurement of uncertainty before 1900. Harvard University Press. ISBN 978-0-674-40340-6.
Stigler, Stephen M. (1999). Statistics on the table: the history of statistical concepts and methods. Harvard University Press. ISBN 978-0-674-83601-3.
Wilks, S. S. (1938), "The Large-Sample Distribution of the Likelihood Ratio for Testing Composite Hypotheses", Annals of Mathematical Statistics, 9: 60–62, doi:10.1214/aoms/1177732360.
Further reading
- Andersen, Erling B. (1970); "Asymptotic Properties of Conditional Maximum Likelihood Estimators", Journal of the Royal Statistical Society B 32, 283–301
- Andersen, Erling B. (1980); Discrete Statistical Models with Social Science Applications, North Holland, 1980
Basu, Debabrata (1988); Statistical Information and Likelihood : A Collection of Critical Essays by Dr. D. Basu; in Ghosh, Jayanta K., editor; Lecture Notes in Statistics, Volume 45, Springer-Verlag, 1988
Einicke, G.A. (2012). Smoothing, Filtering and Prediction: Estimating the Past, Present and Future. Rijeka, Croatia: Intech. ISBN 978-953-307-752-9.
Ferguson, Thomas S. (1982). "An inconsistent maximum likelihood estimate". Journal of the American Statistical Association. 77 (380): 831–834. doi:10.1080/01621459.1982.10477894. JSTOR 2287314.
Ferguson, Thomas S. (1996). A Course in Large Sample Theory. Chapman & Hall. ISBN 978-0-412-04371-0.
Le Cam, Lucien (1990). "Maximum likelihood — an introduction". ISI Review. 58 (2): 153–171. CiteSeerX 10.1.1.140.1997. doi:10.2307/1403464. JSTOR 1403464.
Le Cam, Lucien; Yang, Grace Lo (2000). Asymptotics in Statistics: some basic concepts (Second ed.). Springer. ISBN 978-0-387-95036-5.
Lehmann, Erich L.; Casella, George (1998). Theory of Point Estimation, 2nd ed. Springer. ISBN 978-0-387-98502-2.
Millar, R. B. (2011). Maximum Likelihood Estimation and Inference. Wiley.
Ruppert, David (2010). Statistics and Data Analysis for Financial Engineering. Springer. p. 98. ISBN 978-1-4419-7786-1.
van der Vaart, Aad W. (1998). Asymptotic Statistics. ISBN 978-0-521-78450-4.
External links
Hazewinkel, Michiel, ed. (2001) [1994], "Maximum-likelihood method", Encyclopedia of Mathematics, Springer Science+Business Media B.V. / Kluwer Academic Publishers, ISBN 978-1-55608-010-4
- Maximum Likelihood Estimation Primer (an excellent tutorial)
- Implementing MLE for your own likelihood function using R
Myung, I. J. (2003). "Tutorial on maximum likelihood estimation". Journal of Mathematical Psychology. 47: 90–100. CiteSeerX 10.1.1.74.671. doi:10.1016/S0022-2496(02)00028-7.