Maximum likelihood estimation explained

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 uniform prior distributions (or a normal prior distribution with a standard deviation of infinity). 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

\theta=\left[\theta1,\theta2,\ldots,\thetak\right]T

so that this distribution falls within a parametric family

\{f(;\theta)\mid\theta\in\Theta\},

where

\Theta

is called the parameter space, a finite-dimensional subset of Euclidean space. Evaluating the joint density at the observed data sample

y=(y1,y2,\ldots,yn)

gives a real-valued function,

l{L}n(\theta)=l{L}n(\theta;y)=fn(y;\theta),

which is called the likelihood function. For independent and identically distributed random variables,

fn(y;\theta)

will be the product of univariate density functions:

fn(y;\theta)=

n
\prod
k=1

univar(y
f
k;

\theta)~.

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

\hat{\theta}=\underset{\theta\in\Theta}{\operatorname{argmax}}l{L}n(\theta;y)~.

Intuitively, this selects the parameter values that make the observed data most probable. The specific value

~\hat{\theta}=\hat{\theta}n(y)\in\Theta~

that maximizes the likelihood function

l{L}n

is called the maximum likelihood estimate. Further, if the function

\hat{\theta}n:Rn\to\Theta

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

\Theta

that is compact.[7] For an open

\Theta

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:

\ell(\theta;y)=lnl{L}n(\theta;y)~.

Since the logarithm is a monotonic function, the maximum of

\ell(\theta;y)

occurs at the same value of

\theta

as does the maximum of

l{L}n~.

[8] If

\ell(\theta;y)

is differentiable in

\Theta,

sufficient conditions for the occurrence of a maximum (or a minimum) are
\partial\ell
\partial\theta1

=0,

\partial\ell
\partial\theta2

=0,\ldots,

\partial\ell
\partial\thetak

=0~,

known as the likelihood equations. For some models, these equations can be explicitly solved for

\widehat{\theta},

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

\widehat{\theta}

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

H\left(\widehat{\theta}\right)=\begin{bmatrix}\left.

\partial2\ell
\partial
2
\theta
1

\right|\theta=\widehat{\theta

} & \left. \frac \right|_ & \dots & \left. \frac \right|_ \\ \left. \frac \right|_ & \left. \frac \right|_ & \dots & \left. \frac \right|_ \\ \vdots & \vdots & \ddots & \vdots \\ \left. \frac \right|_ & \left. \frac \right|_ & \dots & \left. \frac \right|_ \end ~,

is negative semi-definite at

\widehat{\theta}

, 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

\Theta=\left\{\theta:\theta\inRk,h(\theta)=0\right\}~,

where

h(\theta)=\left[h1(\theta),h2(\theta),\ldots,hr(\theta)\right]

is a vector-valued function mapping

Rk

into

Rr~.

Estimating the true parameter

\theta

belonging to

\Theta

then, as a practical matter, means to find the maximum of the likelihood function subject to the constraint

~h(\theta)=0~.

Theoretically, the most natural approach to this constrained optimization problem is the method of substitution, that is "filling out" the restrictions

h1,h2,\ldots,hr

to a set

h1,h2,\ldots,hr,hr+1,\ldots,hk

in such a way that

h\ast=\left[h1,h2,\ldots,hk\right]

is a one-to-one function from

Rk

to itself, and reparameterize the likelihood function by setting

\phii=hi(\theta1,\theta2,\ldots,\thetak)~.

[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

\Sigma

must be positive-definite; this restriction can be imposed by replacing

\Sigma=\GammaT\Gamma,

where

\Gamma

is a real upper triangular matrix and

\GammaT

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

\partial\ell
\partial\theta

-

\partialh(\theta)T
\partial\theta

λ=0

and

h(\theta)=0,

where

~λ=\left[λ1,λ2,\ldots,λr\right]T~

is a column-vector of Lagrange multipliers and

\partialh(\theta)T
\partial\theta

is the 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

\widehat{\ell}(\theta;x)

. If the data are independent and identically distributed, then we have
\widehat{\ell}(\theta;x)=1n
\sum
n
i=1

lnf(xi\mid\theta),

this being the sample analogue of the expected log-likelihood

\ell(\theta)=\operatorname{E}[lnf(xi\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. 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:

\hat{\theta}

is the maximum likelihood estimator for

\theta

, and if

g(\theta)

is any transformation of

\theta

, then the maximum likelihood estimator for

\alpha=g(\theta)

is

\hat{\alpha}=g(\hat{\theta})

. This property is less commonly known as functional equivariance. The invariance property holds for arbitrary transformation

g

, although the proof simplifies if

g

is restricted to one-to-one transformations.

Consistency

Under the conditions outlined below, the maximum likelihood estimator is consistent. The consistency means that if the data were generated by

f(;\theta0)

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

\widehat{\theta}

converges in probability to its true value:

\widehat{\theta}mle\xrightarrow{p

}\ \theta_0.

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

\widehat{\theta}mle\xrightarrow{a.s.

}\ \theta_0.

In practical applications, data is never generated by

f(;\theta0)

. Rather,

f(;\theta0)

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.[16]

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

\widehat{\ell}(\theta\midx)

is stochastically equicontinuous.

If one wants to demonstrate that the ML estimator

\widehat{\theta}

converges to θ0 almost surely, then a stronger condition of uniform convergence almost surely has to be imposed:

\sup\theta\in\Theta\left\|\widehat{\ell}(\theta\midx)-\ell(\theta)\right\|\xrightarrow{a.s.

}\ 0.

Additionally, if (as assumed above) the data were generated by

f(;\theta0)

, then under certain conditions, it can also be shown that the maximum likelihood estimator converges in distribution to a normal distribution. Specifically,[17]

\sqrt{n}\left(\widehat{\theta}mle-

-1
\theta
0\right)\xrightarrow{d}l{N}\left(0,I

\right)

where 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

\widehat{\theta}

is the MLE for

\theta

, and if

g(\theta)

is any transformation of

\theta

, then the MLE for

\alpha=g(\theta)

is by definition[18]

\widehat{\alpha}=g(\widehat{\theta}).

It maximizes the so-called profile likelihood:

\bar{L}(\alpha)=\sup\theta:L(\theta).

The MLE is also equivariant 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

fY(y)=

fX(x)
|g'(x)|

and hence the likelihood functions for

X

and

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.

Efficiency

As assumed above, if the data were generated by

~f(;\theta0)~,

then under certain conditions, it can also be shown that the maximum likelihood estimator converges in distribution to a normal distribution. It is -consistent and asymptotically efficient, meaning that it reaches the Cramér–Rao bound. Specifically,[17]

\sqrt{n}\left(\widehat{\theta}mle-\theta0\right)  \xrightarrow{d}  l{N}\left(0,l{I}-1\right)~,

where

~l{I}~

is the Fisher information matrix:

l{I}jk=\operatorname{E}l[-{

2ln
\partial
f
\theta0
(Xt)
\partial\thetaj\partial\thetak

}r]~.

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

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 has bias of order . This bias is equal to (componentwise)[19]

bh\equiv\operatorname{E}l[\left(\widehat\thetamle-\theta0\right)hr] =

1
n

m
\sum
i,j,k=1

l{I}hl{I}j\left(

1
2

Ki+Jj,i\right)

where

l{I}j

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

l{I}-1

, and
1
2

Ki+Jj,i=\operatorname{E}l[ 

12
3
\partialln
f
\theta0
(Xt)
\partial\thetai\partial\thetaj\partial\thetak

+

\partialln
f
\theta0
(Xt)
\partial\thetaj
2ln
\partial
f
\theta0
(Xt)
\partial\thetai\partial\thetak

r]~.

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:

*
\widehat{\theta}
mle

=\widehat{\theta}mle-\widehat{b}~.

This estimator is unbiased up to the terms of order, and is called the bias-corrected maximum likelihood estimator.

This bias-corrected estimator is (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  . 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.[20]

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:

\operatorname{P}(\theta\midx1,x2,\ldots,xn)=

f(x1,x2,\ldots,xn\mid\theta)\operatorname{P
(\theta)}{\operatorname{P}(x

1,x2,\ldots,xn)}

where

\operatorname{P}(\theta)

is the prior distribution for the parameter and where

\operatorname{P}(x1,x2,\ldots,xn)

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,\ldots,xn\mid\theta)\operatorname{P}(\theta)

with respect to . If we further assume that the prior

\operatorname{P}(\theta)

is a uniform distribution, the Bayesian estimator is obtained by maximizing the likelihood function

f(x1,x2,\ldots,xn\mid\theta)

. Thus the Bayesian estimator coincides with the maximum likelihood estimator for a uniform prior distribution

\operatorname{P}(\theta)

.

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.[21]

Thus, the Bayes Decision Rule is stated as

"decide

w1 

if

~\operatorname{P}(w1|x)>\operatorname{P}(w2|x)~;~

otherwise decide

w2 

"where

w1,w2 

are predictions of different classes. From a perspective of minimizing error, it can also be stated as

w=\underset{w}{\operatorname{argmax}}

infty
\int
-infty

\operatorname{P}(error\midx)\operatorname{P}(x)\operatorname{d}x~

where

\operatorname{P}(error\midx)=\operatorname{P}(w1\midx)~

if we decide

w2 

and

\operatorname{P}(error\midx)=\operatorname{P}(w2\midx)

if we decide

w1 .

By applying Bayes' theorem

\operatorname{P}(wi\midx)=

\operatorname{P
(x

\midwi)\operatorname{P}(wi)}{\operatorname{P}(x)}

,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:

hBayes=\underset{w}{\operatorname{argmax}}l[\operatorname{P}(x\midw)\operatorname{P}(w)r],

where

hBayes

is the prediction and

\operatorname{P}(w) 

is the prior probability.

Relation to minimizing Kullback–Leibler divergence and cross entropy

Finding

\hat\theta

that maximizes the likelihood is asymptotically equivalent to finding the

\hat\theta

that defines a probability distribution (

Q\hat

) 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
P
\theta0
).[22] In an ideal world, P and Q are the same (and the only thing unknown is

\theta

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

\hat\theta

) to the real distribution
P
\theta0
.[23]
Proof.
For simplicity of notation, let's assume that P=Q. Let there be n i.i.d data samples

y=(y1,y2,\ldots,yn)

from some probability

y\sim

P
\theta0
, that we try to estimate by finding

\hat\theta

that will maximize the likelihood using

P\theta

, then:

\begin{align} \hat\theta&=\underset{\theta}{\operatorname{argmax}}

L
P\theta

(y)=\underset{\theta}{\operatorname{argmax}}P\theta(y)=\underset{\theta}{\operatorname{argmax}}P(y\mid\theta)\\ &=\underset{\theta}{\operatorname{argmax}}

n
\prod
i=1

P(yi\mid\theta)=\underset{\theta}{\operatorname{argmax}}

n
\sum
i=1

logP(yi\mid\theta)\\ &=\underset{\theta}{\operatorname{argmax}}\left(

n
\sum
i=1

logP(yi\mid\theta)-

n
\sum
i=1

logP(yi\mid\theta0)\right)=\underset{\theta}{\operatorname{argmax}}

n
\sum
i=1

\left(logP(yi\mid\theta)-logP(yi\mid\theta0)\right)\\ &=\underset{\theta}{\operatorname{argmax}}

n
\sumlog
i=1
P(yi\mid\theta)
P(yi\mid\theta0)

=\underset{\theta}{\operatorname{argmin}}

n
\sum
i=1

log

P(yi\mid\theta0)
P(yi\mid\theta)

=\underset{\theta}{\operatorname{argmin}}

1
n
n
\sum
i=1

log

P(yi\mid\theta0)
P(yi\mid\theta)

\\ &=\underset{\theta}{\operatorname{argmin}}

1
n
n
\sum
i=1

h\theta(yi)\underset{n\toinfty}{\longrightarrow}\underset{\theta}{\operatorname{argmin}}E[h\theta(y)]\\ &=\underset{\theta}{\operatorname{argmin}}\int

P
\theta0

(y)h\theta(y)dy=\underset{\theta}{\operatorname{argmin}}\int

P
\theta0

(y)log

P(y\mid\theta0)
P(y\mid\theta)

dy\\ &=\underset{\theta}{\operatorname{argmin}}DKL(P

\theta0

\parallelP\theta)\end{align}

Where

h\theta(x)=log

P(x\mid\theta0)
P(x\mid\theta)
. Using h helps see how we are using the law of large numbers to move from the average of h(x) to the expectancy of it using the law of the unconscious statistician. The first several transitions have to do with laws of logarithm and that finding

\hat\theta

that maximizes some function will also be the one that maximizes some monotonic transformation of that function (i.e.: adding/multiplying by a constant).

Since cross entropy is just Shannon's entropy plus KL divergence, and since the entropy of

P
\theta0
is constant, then the MLE is also asymptotically minimizing cross entropy.[24]

Examples

Discrete uniform distribution

See main article: German tank problem. 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

\widehat{n}

of n is the number m on the drawn ticket. (The likelihood is 0 for n < m, 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, 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

\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 = , one which gives heads with probability p =  and another which gives heads with probability p = . 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:

\begin{align} \operatorname{P}l[ H=49\midp=\tfrac{1}{3}r]&=\binom{80}{49}(\tfrac{1}{3})49(1-\tfrac{1}{3})310.000,\\[6pt] \operatorname{P}l[ H=49\midp=\tfrac{1}{2}r]&=\binom{80}{49}(\tfrac{1}{2})49(1-\tfrac{1}{2})310.012,\\[6pt] \operatorname{P}l[ H=49\midp=\tfrac{2}{3}r]&=\binom{80}{49}(\tfrac{2}{3})49(1-\tfrac{2}{3})310.054~. \end{align}

The likelihood is maximized when  = , and so this is the maximum likelihood estimate for .

Discrete distribution, continuous parameter space

Now suppose that there was only one coin but its could have been any value The likelihood function to be maximised is

L(p)=fD(H=49\midp)=\binom{80}{49}p49(1-p)31~,

and the maximisation is over all possible values

One way to maximize this function is by differentiating with respect to and setting to zero:

\begin{align} 0&=

\partial
\partialp

\left(\binom{80}{49}p49(1-p)31\right)~,\\[8pt] 0&=49p48(1-p)31-31p49(1-p)30\\[8pt] &=p48(1-p)30\left[49(1-p)-31p\right]\\[8pt] &=p48(1-p)30\left[49-80p\right]~. \end{align}

This is a product of three terms. The first term is 0 when  = 0. The second is 0 when  = 1. The third is zero when  = . The solution that maximizes the likelihood is clearly  =  (since  = 0 and  = 1 result in a likelihood of 0). Thus the maximum likelihood estimator for is .

This result is easily generalized by substituting a letter such as in the place of 49 to represent the observed number of 'successes' of our Bernoulli trials, and a letter such as in the place of 80 to represent the number of Bernoulli trials. Exactly the same calculation yields which is the maximum likelihood estimator for any sequence of Bernoulli trials resulting in 'successes'.

Continuous distribution, continuous parameter space

l{N}(\mu,\sigma2)

which has probability density function

f(x\mid\mu,\sigma2)=

1
\sqrt{2\pi\sigma2

} \exp\left(-

(x-\mu)2
2\sigma2

\right),

the corresponding probability density function for a sample of independent identically distributed normal random variables (the likelihood) is

f(x1,\ldots,xn\mid\mu,\sigma2)=

n
\prod
i=1

f(xi\mid\mu,\sigma2)=\left(

1
2\pi\sigma2

\right)n/2\exp\left(-

n
\sum
i=1
2
(x
i-\mu)
2\sigma2

\right).

This family of distributions has two parameters: ; so we maximize the likelihood,

l{L}(\mu,\sigma2)=f(x1,\ldots,xn\mid\mu,\sigma2)

, 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:

logl(l{L}(\mu,\sigma2)r)=-

n
2

log(2\pi\sigma2) -

1
2\sigma2
n
\sum
i=1
2
(x
i-\mu)

(Note: the log-likelihood is closely related to information entropy and Fisher information.)

We now compute the derivatives of this log-likelihood as follows.

\begin{align} 0&=

\partial
\partial\mu

logl(l{L}(\mu,\sigma2)r)= 0-

 -2n(\bar{x
-\mu)}{2\sigma

2}. \end{align}

where

\bar{x}

is the sample mean. This is solved by

\widehat\mu=\bar{x}=

n
\sum
i=1
xi
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,

\operatorname{E}l[ \widehat\mu r]=\mu,

which means that the maximum likelihood estimator

\widehat\mu

is unbiased.

Similarly we differentiate the log-likelihood with respect to and equate to zero:

\begin{align} 0&=

\partial
\partial\sigma

logl(l{L}(\mu,\sigma2)r)=-

n
\sigma

+

1
\sigma3
n
\sum
i=1
2. \end{align}
(x
i-\mu)

which is solved by

\widehat\sigma2=

1
n
2.
\sum
i-\mu)

Inserting the estimate

\mu=\widehat\mu

we obtain

\widehat\sigma2=

1
n
n
\sum
i=1

(xi-\bar{x})2=

1
n
n
\sum
i=1
2
x-
i
1
n2
n
\sum
j=1

xixj.

To calculate its expected value, it is convenient to rewrite the expression in terms of zero-mean random variables (statistical error)

\deltai\equiv\mu-xi

. Expressing the estimate in these variables yields

\widehat\sigma2=

1
n
n
\sum
i=1

(\mu-

2
\delta-
i)
1
n2
n
\sum
j=1

(\mu-\deltai)(\mu-\deltaj).

Simplifying the expression above, utilizing the facts that

\operatorname{E}l[ \deltair]=0

and
2 r]
\operatorname{E}l[\delta
i

=\sigma2

, allows us to obtain

\operatorname{E}l[ \widehat\sigma2 r]=

n-1
n

\sigma2.

This means that the estimator

\widehat\sigma2

is biased for

\sigma2

. It can also be shown that

\widehat\sigma

is biased for

\sigma

, but that both

\widehat\sigma2

and

\widehat\sigma

are consistent.

Formally we say that the maximum likelihood estimator for

\theta=(\mu,\sigma2)

is

\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:

logl(l{L}(\widehat\mu,\widehat\sigma)r)=

-n  
2

l(log(2\pi\widehat\sigma2)+1r)

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

y1

and

y2

are independent only if their joint probability density function is the product of the individual probability density functions, i.e.

f(y1,y2)=f(y1)f(y2)

Suppose one constructs an order-n Gaussian vector out of random variables

(y1,\ldots,yn)

, where each variable has means given by

(\mu1,\ldots,\mun)

. Furthermore, let the covariance matrix be denoted by

\Sigma

. The joint probability density function of these n random variables then follows a multivariate normal distribution given by:

f(y1,\ldots,y

n)=1
(2\pi)n/2\sqrt{\det(\Sigma)
} \exp\left(-\frac \left[y_1-\mu_1,\ldots,y_n-\mu_n\right]\mathit\Sigma^ \left[y_1-\mu_1,\ldots,y_n-\mu_n\right]^\mathrm \right)

In the bivariate case, the joint probability density function is given by:

f(y1,y2)=

1
2\pi\sigma1\sigma2\sqrt{1-\rho2
} \exp\left[-\frac{1}{2(1-\rho^2)} \left(\frac{(y_1-\mu_1)^2}{\sigma_1^2} - \frac{2\rho(y_1-\mu_1)(y_2-\mu_2)}{\sigma_1\sigma_2} + \frac{(y_2-\mu_2)^2}{\sigma_2^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.

Example

X1,X2,\ldots,Xm

are counts in cells / boxes 1 up to m; each box has a different probability (think of the boxes being bigger or smaller) and we fix the number of balls that fall to be

n

:

x1+x2+ … +xm=n

. The probability of each box is

pi

, with a constraint:

p1+p2+ … +pm=1

. This is a case in which the

Xi

s are not independent, the joint probability of a vector

x1,x2,\ldots,xm

is called the multinomial and has the form:

f(x1,x2,\ldots,xm\midp1,p2,\ldots,p

m)=n!
\prodxi!

\prod

xi
p
i

=\binom{n}{x1,x2,\ldots,xm}

x1
p
1
x2
p
2

xm
p
m

Each box taken separately against all the other boxes is a binomial and this is an extension thereof.

The log-likelihood of this is:

\ell(p1,p2,\ldots,pm)=log

m
n!-\sum
i=1

logxi!+\sum

m
i=1

xilogpi

The constraint has to be taken into account and use the Lagrange multipliers:

L(p1,p2,\ldots,pm,λ)=\ell(p1,p2,\ldots,pm)\left(1-\sum

m
i=1

pi\right)

By posing all the derivatives to be 0, the most natural estimate is derived

\hat{p}
i=xi
n

Maximizing log likelihood, with and without constraints, can be an unsolvable problem in closed form, then we have to use iterative procedures.

Iterative procedures

Except for special cases, the likelihood equations

\partial\ell(\theta;y)
\partial\theta

=0

cannot be solved explicitly for an estimator

\widehat{\theta}=\widehat{\theta}(y)

. Instead, they need to be solved iteratively: starting from an initial guess of

\theta

(say

\widehat{\theta}1

), one seeks to obtain a convergent sequence

\left\{\widehat{\theta}r\right\}

. Many methods for this kind of optimization problem are available,[25] [26] but the most commonly used ones are algorithms based on an updating formula of the form

\widehat{\theta}r+1=\widehat{\theta}r+ηrdr\left(\widehat{\theta}\right)

where the vector

dr\left(\widehat{\theta}\right)

indicates the descent direction of the rth "step," and the scalar

ηr

captures the "step length,"[27] [28] also known as the learning rate.[29]

Gradient descent method

(Note: here it is a maximization problem, so the sign before gradient is flipped)

ηr\in\R+

that is small enough for convergence and

dr\left(\widehat{\theta}\right)=\nabla\ell\left(\widehat{\theta}r;y\right)

Gradient descent method requires to calculate the gradient at the rth iteration, but no need to calculate the inverse of second-order derivative, i.e., the Hessian matrix. Therefore, it is computationally faster than Newton-Raphson method.

ηr=1

and

dr\left(\widehat{\theta}\right)=

-1
-H
r\left(\widehat{\theta}\right)

sr\left(\widehat{\theta}\right)

where

sr(\widehat{\theta})

is the score and
-1
H
r

\left(\widehat{\theta}\right)

is the inverse of the Hessian matrix of the log-likelihood function, both evaluated the rth iteration.[30] [31] But because the calculation of the Hessian matrix is computationally costly, numerous alternatives have been proposed. The popular Berndt–Hall–Hall–Hausman algorithm approximates the Hessian with the outer product of the expected gradient, such that

dr\left(\widehat{\theta}\right)=-\left[

1
n
n
\sum
t=1
\partial\ell(\theta;y)
\partial\theta

\left(

\partial\ell(\theta;y)
\partial\theta

\right)T\right]-1sr\left(\widehat{\theta}\right)

Quasi-Newton methods

Other quasi-Newton methods use more elaborate secant updates to give approximation of Hessian matrix.

DFP formula finds a solution that is symmetric, positive-definite and closest to the current approximate value of second-order derivative:

Hk+1= \left(I-\gammakyk

T\right)
s
k

Hk\left(I-\gammaksk

T\right)
y
k

+\gammakyk

T,
y
k

where

yk=\nabla\ell(xk+sk)-\nabla\ell(xk),

\gammak=

1
T
ysk
k

,

sk=xk+1-xk.

BFGS also gives a solution that is symmetric and positive-definite:

Bk+1=Bk+

y
T
y
k
k
T
ysk
k

-

Bsk
T
s
k
T
B
k
k
T
sBksk
k

,

where

yk=\nabla\ell(xk+sk)-\nabla\ell(xk),

sk=xk+1-xk.

BFGS method is not guaranteed to converge unless the function has a quadratic Taylor expansion near an optimum. However, BFGS can have acceptable performance even for non-smooth optimization instances

Another popular method is to replace the Hessian with the Fisher information matrix,

l{I}(\theta)=\operatorname{E}\left[Hr\left(\widehat{\theta}\right)\right]

, giving us the Fisher scoring algorithm. This procedure is standard in the estimation of many methods, such as generalized linear models.

Although popular, quasi-Newton methods may converge to a stationary point that is not necessarily a local or global maximum,[32] but rather a local minimum or a saddle point. Therefore, it is important to assess the validity of the obtained solution to the likelihood equations, by verifying that the Hessian, evaluated at the solution, is both negative definite and well-conditioned.[33]

History

Early users of maximum likelihood include Carl Friedrich Gauss, Pierre-Simon Laplace, Thorvald N. Thiele, and Francis Ysidro Edgeworth.[34] [35] It was Ronald Fisher however, between 1912 and 1922, who singlehandedly created the modern version of the method.[36] [37]

Maximum-likelihood estimation finally transcended heuristic justification in a proof published by Samuel S. Wilks in 1938, now called Wilks' theorem.[38] The theorem shows that the error in the logarithm of likelihood values for estimates from multiple independent observations is asymptotically χ&thinsp;2-distributed, which enables convenient determination of a confidence region around any estimate of the parameters. The only difficult part of Wilks' proof depends on the expected value of the Fisher information matrix, which is provided by a theorem proven by Fisher.[39] Wilks continued to improve on the generality of the theorem throughout his life, with his most general proof published in 1962.[40]

Reviews of the development of maximum likelihood estimation have been provided by a number of authors.[41] [42] [43] [44] [45] [46] [47] [48]

See also

Related concepts

Other estimation methods

Further reading

External links

Notes and References

  1. Book: Rossi, Richard J. . Mathematical Statistics: An Introduction to Likelihood Based Inference . New York . John Wiley & Sons . 2018 . 978-1-118-77104-4 . 227 .
  2. Book: David F. . Hendry . David Forbes Hendry . Bent . Nielsen . Econometric Modeling: A Likelihood Approach . Princeton . Princeton University Press . 2007 . 978-0-691-13128-3 .
  3. Book: Raymond L. . Chambers . David G. . Steel . Suojin . Wang . Alan . Welsh . Maximum Likelihood Estimation for Sample Surveys . Boca Raton . CRC Press . 2012 . 978-1-58488-632-7 .
  4. Book: Michael Don . Ward . Michael D. Ward . John S. . Ahlquist . Maximum Likelihood for Social Science: Strategies for Analysis . New York . Cambridge University Press . 2018 . 978-1-107-18582-1 .
  5. Book: Press . W.H. . Flannery . B.P. . Teukolsky . S.A. . Vetterling . W.T. . Least Squares as a Maximum Likelihood Estimator . Numerical Recipes in FORTRAN: The Art of Scientific Computing . 2nd . Cambridge . Cambridge University Press . 651–655 . 1992 . 0-521-43064-X . https://books.google.com/books?id=gn_4mpdN9WkC&pg=PA651 .
  6. Myung . I.J. . 2003 . Tutorial on maximum likelihood Estimation . . 47 . 1 . 90–100 . 10.1016/S0022-2496(02)00028-7 .
  7. Book: Christian . Gourieroux . Alain . Monfort . 1995 . Statistics and Econometrics Models . Cambridge University Press . 0-521-40551-3 . 161 . limited.
  8. Book: Kane, Edward J. . 1968 . Economic Statistics and Econometrics . New York, NY . Harper & Row . 179 . registration.
  9. Book: Christoper G. . Small . Jinfang . Wang . 2003 . Working with roots . Numerical Methods for Nonlinear Estimating Equations . Oxford University Press . 0-19-850688-0 . 74–124 . https://books.google.com/books?id=hMrwQVllY5AC&pg=PA74 .
  10. Book: Robert E. . Kass . Paul W. . Vos . 1997 . Geometrical Foundations of Asymptotic Inference . 14 . New York, NY . John Wiley & Sons . 0-471-82668-5 .
  11. Web site: Alecos . Papadopoulos . 25 September 2013 . Why we always put log before the joint pdf when we use MLE (Maximum likelihood Estimation)? . .
  12. Book: Silvey, S. D. . 1975 . Statistical Inference . London, UK . Chapman and Hall . 0-412-13820-4 . 79 .
  13. Web site: David . Olive . 2004 . Does the MLE maximize the likelihood? . Southern Illinois University .
  14. Daniel P. . Schwallie . 1985 . Positive definite maximum likelihood covariance estimators . Economics Letters . 17 . 1–2 . 115–117 . 10.1016/0165-1765(85)90139-9 .
  15. Book: Magnus, Jan R. . 2017 . Introduction to the Theory of Econometrics . Amsterdam . VU University Press . 64–65 . 978-90-8659-766-6.
  16. By Theorem 2.5 in Book: Newey . Whitney K. . McFadden . Daniel . Daniel McFadden . Chapter 36: Large sample estimation and hypothesis testing . Robert . Engle . Dan . McFadden . Handbook of Econometrics, Vol.4 . 1994 . Elsevier Science . 2111–2245 . 978-0-444-88766-5 .
  17. By Theorem 3.3 in Book: Newey . Whitney K. . McFadden . Daniel . Daniel McFadden . Chapter 36: Large sample estimation and hypothesis testing . Robert . Engle . Dan . McFadden . Handbook of Econometrics, Vol.4 . 1994 . Elsevier Science . 2111–2245 . 978-0-444-88766-5 .
  18. Book: Zacks, Shelemyahu . The Theory of Statistical Inference . New York . John Wiley & Sons . 1971 . 0-471-98103-6 . 223 .
  19. See formula 20 inCox . David R. . David R. Cox . Snell . E. Joyce . Joyce Snell . A general definition of residuals . 1968 . . 248–275 . 2984505 . 30 . 2.
  20. Kano . Yutaka . Third-order efficiency implies fourth-order efficiency . 1996 . Journal of the Japan Statistical Society . 26 . 101–117 . 10.14490/jjss1995.26.101 . free .
  21. Web site: Christensen . Henrikt I. . Pattern Recognition . Georgia Tech . Bayesian Decision Theory - CS 7616 . lecture.
  22. cmplx96 (https://stats.stackexchange.com/users/177679/cmplx96), Kullback–Leibler divergence, URL (version: 2017-11-18): https://stats.stackexchange.com/q/314472 (at the youtube video, look at minutes 13 to 25)
  23. https://web.stanford.edu/class/stats200/Lecture16.pdf Introduction to Statistical Inference | Stanford (Lecture 16 — MLE under model misspecification)
  24. Sycorax says Reinstate Monica (https://stats.stackexchange.com/users/22311/sycorax-says-reinstate-monica), the relationship between maximizing the likelihood and minimizing the cross-entropy, URL (version: 2019-11-06): https://stats.stackexchange.com/q/364237
  25. Book: Fletcher , R. . 1987 . Practical Methods of Optimization . New York, NY . John Wiley & Sons . Second . 0-471-91547-5 . registration.
  26. Book: Jorge . Nocedal . Jorge Nocedal . Stephen J. . Wright . 2006 . Numerical Optimization . New York, NY . Springer . Second . 0-387-30303-0.
  27. Book: Daganzo, Carlos . Multinomial Probit: The Theory and its Application to Demand Forecasting . New York . Academic Press . 1979 . 0-12-201150-3 . 61–78 .
  28. Book: William . Gould . Jeffrey . Pitblado . Brian . Poi . Maximum Likelihood Estimation with Stata . College Station . Stata Press . 2010 . Fourth . 978-1-59718-078-8 . 13–20 .
  29. Book: Murphy, Kevin P. . Machine Learning: A Probabilistic Perspective . Cambridge . MIT Press . 2012 . 978-0-262-01802-9 . 247 .
  30. Book: Amemiya, Takeshi . Takeshi Amemiya . Advanced Econometrics . Cambridge . Harvard University Press . 1985 . 0-674-00560-0 . 137–138 .
  31. Book: Sargan, Denis . Denis Sargan . Methods of Numerical Optimization . Lecture Notes on Advanced Econometric Theory . Oxford . Basil Blackwell . 1988 . 0-631-14956-2 . 161–169 .
  32. See theorem 10.1 inBook: Avriel , Mordecai . 1976 . Nonlinear Programming: Analysis and Methods . 293–294 . Englewood Cliffs, NJ . Prentice-Hall . 978-0-486-43227-4 .
  33. Book: Philip E. . Gill . Walter . Murray . Margaret H. . Wright . Margaret H. Wright . 1981 . Practical Optimization . London, UK . Academic Press . 312–313 . 0-12-283950-1 . limited.
  34. 10.2307/2339293 . Edgeworth . Francis Y. . Francis Ysidro Edgeworth . On the probable errors of frequency-constants . Sep 1908 . CITEREFEdgeworthSeptember_1908 . Journal of the Royal Statistical Society . 71 . 3 . 499–512 . 2339293 .
  35. 10.2307/2339378 . Edgeworth . Francis Y. . On the probable errors of frequency-constants . Dec 1908 . CITEREFEdgeworthDecember_1908 . Journal of the Royal Statistical Society . 71 . 4 . 651–678 . 2339378 .
  36. Book: Pfanzagl . Johann . 1994 . Parametric Statistical Theory . . 978-3-11-013863-4 . 207–208 . 10.1515/9783110889765 . 1291393.
  37. Hald . Anders . 1999 . On the History of Maximum Likelihood in Relation to Inverse Probability and Least Squares . Statistical Science . 14 . 2 . 214–222 . 0883-4237.
  38. Wilks . S.S. . 1938 . The large-sample distribution of the likelihood ratio for testing composite hypotheses . . 9 . 60–62 . 10.1214/aoms/1177732360 . free.
  39. Book: Owen, Art B. . 2001 . Empirical Likelihood . London, UK; Boca Raton, FL . Chapman & Hall; CRC Press . 978-1-58488-071-4.
  40. Book: Wilks, Samuel S. . 1962 . Mathematical Statistics . New York, NY . John Wiley & Sons . 978-0-471-94650-2.
  41. 10.1214/aos/1176343456 . Savage . Leonard J. . Leonard J. Savage . On rereading R.A. Fisher . 1976 . The Annals of Statistics . 4 . 3 . 441–500 . 2958221 . free.
  42. 10.1214/aos/1176343457 . Pratt . John W. . F. Y. Edgeworth and R. A. Fisher on the efficiency of maximum likelihood estimation . 1976 . The Annals of Statistics . 4 . 3 . 501–514 . 2958222 . free.
  43. 10.2307/2344804 . Stigler . Stephen M. . Stephen M. Stigler . Francis Ysidro Edgeworth, statistician . 1978 . Journal of the Royal Statistical Society, Series A . 141 . 3 . 287–322 . 2344804 .
  44. Book: Stigler, Stephen M. . The history of statistics: the measurement of uncertainty before 1900 . 1986 . Harvard University Press . 978-0-674-40340-6 .
  45. Book: Stigler, Stephen M. . Statistics on the table: the history of statistical concepts and methods . 1999 . Harvard University Press . 978-0-674-83601-3 .
  46. Book: Hald, Anders . Anders Hald . A history of mathematical statistics from 1750 to 1930 . 1998 . Wiley . New York, NY . 978-0-471-17912-2 .
  47. Hald . Anders . On the history of maximum likelihood in relation to inverse probability and least squares . 1999 . Statistical Science . 14 . 2 . 214–222 . 2676741 . 10.1214/ss/1009212248 . free.
  48. Aldrich . John . R.A. Fisher and the making of maximum likelihood 1912–1922 . 1997 . Statistical Science . 12 . 3 . 162–176 . 10.1214/ss/1030037906 . 1617519 . free.