# Maximum a posteriori estimation

(Redirected from Maximum a posteriori)
Jump to: navigation, search

In Bayesian statistics, a maximum a posteriori probability (MAP) estimate is a mode of the posterior distribution. The MAP can be used to obtain a point estimate of an unobserved quantity on the basis of empirical data. It is closely related to Fisher's method of maximum likelihood (ML), but employs an augmented optimization objective which incorporates a prior distribution over the quantity one wants to estimate. MAP estimation can therefore be seen as a regularization of ML estimation.

## Description

Assume that we want to estimate an unobserved population parameter ${\displaystyle \theta }$ on the basis of observations ${\displaystyle x}$. Let ${\displaystyle f}$ be the sampling distribution of ${\displaystyle x}$, so that ${\displaystyle f(x\mid \theta )}$ is the probability of ${\displaystyle x}$ when the underlying population parameter is ${\displaystyle \theta }$. Then the function:

${\displaystyle \theta \mapsto f(x\mid \theta )\!}$

is known as the likelihood function and the estimate:

${\displaystyle {\hat {\theta }}_{\mathrm {ML} }(x)={\underset {\theta }{\operatorname {arg\,max} }}\ f(x\mid \theta )\!}$

is the maximum likelihood estimate of ${\displaystyle \theta }$.

Now assume that a prior distribution ${\displaystyle g}$ over ${\displaystyle \theta }$ exists. This allows us to treat ${\displaystyle \theta }$ as a random variable as in Bayesian statistics. Then the posterior distribution of ${\displaystyle \theta }$ is as follows:

${\displaystyle \theta \mapsto f(\theta \mid x)={\frac {f(x\mid \theta )\,g(\theta )}{\displaystyle \int _{\vartheta \in \Theta }f(x\mid \vartheta )\,g(\vartheta )\,d\vartheta }}\!}$

where ${\displaystyle g}$ is density function of ${\displaystyle \theta }$, ${\displaystyle \Theta }$ is the domain of ${\displaystyle g}$. This is a straightforward application of Bayes' theorem.

The method of maximum a posteriori estimation then estimates ${\displaystyle \theta }$ as the mode of the posterior distribution of this random variable:

${\displaystyle {\hat {\theta }}_{\mathrm {MAP} }(x)={\underset {\theta }{\operatorname {arg\,max} }}\ {\frac {f(x\mid \theta )\,g(\theta )}{\displaystyle \int _{\vartheta }f(x\mid \vartheta )\,g(\vartheta )\,d\vartheta }}={\underset {\theta }{\operatorname {arg\,max} }}\ f(x\mid \theta )\,g(\theta ).\!}$

The denominator of the posterior distribution (so-called marginal likelihood) does not depend on ${\displaystyle \theta }$ and therefore plays no role in the optimization. Observe that the MAP estimate of ${\displaystyle \theta }$ coincides with the ML estimate when the prior ${\displaystyle g}$ is uniform (that is, a constant function). And when the loss function is of the form:

${\displaystyle L(\theta ,a)={\begin{cases}0,&{\text{if }}|a-\theta |

as ${\displaystyle c}$ goes to 0, the sequence of Bayes estimators approaches the MAP estimator, provided that the distribution of ${\displaystyle \theta }$ is unimodal. But generally a MAP estimator is not a Bayes estimator unless ${\displaystyle \theta }$ is discrete.

## Computation

MAP estimates can be computed in several ways:

1. Analytically, when the mode(s) of the posterior distribution can be given in closed form. This is the case when conjugate priors are used.
2. Via numerical optimization such as the conjugate gradient method or Newton's method. This usually requires first or second derivatives, which have to be evaluated analytically or numerically.
3. Via a modification of an expectation-maximization algorithm. This does not require derivatives of the posterior density.
4. Via a Monte Carlo method using simulated annealing

## Criticism

While MAP estimation is a limit of Bayes estimators (under the 0-1 loss function), it is not very representative of Bayesian methods in general. This is because MAP estimates are point estimates, whereas Bayesian methods are characterized by the use of distributions to summarize data and draw inferences: thus, Bayesian methods tend to report the posterior mean or median instead, together with credible intervals. This is both because these estimators are optimal under squared-error and linear-error loss respectively - which are more representative of typical loss functions - and because the posterior distribution may not have a simple analytic form: in this case, the distribution can be simulated using Markov chain Monte Carlo techniques, while optimization to find its mode(s) may be difficult or impossible[citation needed].

An example of a density of a bimodal distribution in which the highest mode is uncharacteristic of the majority of the distribution

In many types of models, such as mixture models, the posterior may be multi-modal. In such a case, the usual recommendation is that one should choose the highest mode: this is not always feasible (global optimization is a difficult problem), nor in some cases even possible (such as when identifiability issues arise). Furthermore, the highest mode may be uncharacteristic of the majority of the posterior.

Finally, unlike ML estimators, the MAP estimate is not invariant under reparameterization. Switching from one parameterization to another involves introducing a Jacobian that impacts on the location of the maximum.[1]

As an example of the difference between Bayes estimators mentioned above (mean and median estimators) and using a MAP estimate, consider the case where there is a need to classify inputs ${\displaystyle x}$ as either positive or negative (for example, loans as risky or safe). Suppose there are just three possible hypotheses about the correct method of classification ${\displaystyle h_{1}}$, ${\displaystyle h_{2}}$ and ${\displaystyle h_{3}}$ with posteriors 0.4, 0.3 and 0.3 respectively. Suppose given a new instance, ${\displaystyle x}$, ${\displaystyle h_{1}}$ classifies it as positive, whereas the other two classify it as negative. Using the MAP estimate for the correct classifier ${\displaystyle h_{1}}$, ${\displaystyle x}$ is classified as positive, whereas the Bayes estimators would average over all hypotheses and classify ${\displaystyle x}$ as negative.

## Example

Suppose that we are given a sequence ${\displaystyle (x_{1},\dots ,x_{n})}$ of IID ${\displaystyle N(\mu ,\sigma _{v}^{2})}$ random variables and an a priori distribution of ${\displaystyle \mu }$ is given by ${\displaystyle N(\mu _{0},\sigma _{m}^{2})}$. We wish to find the MAP estimate of ${\displaystyle \mu }$. Note that the normal distribution is its own conjugate prior, so we will be able to find a closed-form solution analytically.

The function to be maximized is then given by

${\displaystyle f(\mu )f(x\mid \mu )=\pi (\mu )L(\mu )={\frac {1}{{\sqrt {2\pi }}\sigma _{m}}}\exp \left(-{\frac {1}{2}}\left({\frac {\mu -\mu _{0}}{\sigma _{m}}}\right)^{2}\right)\prod _{j=1}^{n}{\frac {1}{{\sqrt {2\pi }}\sigma _{v}}}\exp \left(-{\frac {1}{2}}\left({\frac {x_{j}-\mu }{\sigma _{v}}}\right)^{2}\right),}$

which is equivalent to minimizing the following function of ${\displaystyle \mu }$:

${\displaystyle \sum _{j=1}^{n}\left({\frac {x_{j}-\mu }{\sigma _{v}}}\right)^{2}+\left({\frac {\mu -\mu _{0}}{\sigma _{m}}}\right)^{2}.}$

Thus, we see that the MAP estimator for μ is given by

${\displaystyle {\hat {\mu }}_{\mathrm {MAP} }={\frac {n\sigma _{m}^{2}}{n\sigma _{m}^{2}+\sigma _{v}^{2}}}\left({\frac {1}{n}}\sum _{j=1}^{n}x_{j}\right)+{\frac {\sigma _{v}^{2}}{n\sigma _{m}^{2}+\sigma _{v}^{2}}}\mu _{0}.}$

which turns out to be a linear interpolation between the prior mean and the sample mean weighted by their respective covariances.

The case of ${\displaystyle \sigma _{m}\to \infty }$ is called a non-informative prior and leads to an ill-defined a priori probability distribution; in this case ${\displaystyle {\hat {\mu }}_{\mathrm {MAP} }\to {\hat {\mu }}_{ML}.}$

## Applications

In hydrology and petroleum, MAP estimate of subsurface reservoir models are computed through solving a nonlinear optimization problem.[2]

## References

1. ^ Murphy, Kevin P. (2012). Machine learning : a probabilistic perspective. Cambridge, MA: MIT Press. pp. 151–152. ISBN 0262018020.
2. ^ Shirangi, M G (2014). "History matching production data and uncertainty assessment with an efficient TSVD parameterization algorithm". Journal of Petroleum Science and Engineering 113: 54–71. doi:10.1016/j.petrol.2013.11.025.
• M. DeGroot, Optimal Statistical Decisions, McGraw-Hill, (1970).
• Harold W. Sorenson, (1980) "Parameter Estimation: Principles and Problems", Marcel Dekker.