Skip to content
Surf Wiki
Save to docs
science/mathematics

From Surf Wiki (app.surf) — the open knowledge base

Maximum a posteriori estimation

Method of estimating the parameters of a statistical model


Method of estimating the parameters of a statistical model

An estimation procedure that is often claimed to be part of Bayesian statistics is the maximum a posteriori (MAP) estimate of an unknown quantity, that equals the mode of the posterior density with respect to some reference measure, typically the Lebesgue measure. 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 the method of maximum likelihood (ML) estimation, but employs an augmented optimization objective which incorporates a prior density over the quantity one wants to estimate. MAP estimation is therefore a regularization of maximum likelihood estimation, so is not a well-defined statistic of the Bayesian posterior distribution.

Description

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

:\theta \mapsto f(x \mid \theta) !

is known as the likelihood function and the estimate:

:\hat{\theta}_{\mathrm{MLE}}(x) = \underset{\theta}{\operatorname{arg,max}} \ f(x \mid \theta) !

is the maximum likelihood estimate of \theta.

Now assume that a prior distribution g over \theta exists. This allows us to treat \theta as a random variable as in Bayesian statistics. We can calculate the posterior density of \theta using Bayes' theorem:

:\theta \mapsto f(\theta \mid x) = \frac{f(x \mid \theta) , g(\theta)}{\displaystyle\int_{\Theta} f(x \mid \vartheta) , g(\vartheta) , d\vartheta} !

where g is density function of \theta, \Theta is the domain of g.

The method of maximum a posteriori estimation then estimates \theta as the mode of the posterior density of this random variable:

:\begin{align} \hat{\theta}{\mathrm{MAP}}(x) & = \underset{\theta}{\operatorname{arg,max}} \ f(\theta \mid x) \ & = \underset{\theta}{\operatorname{arg,max}} \ \frac{f(x \mid \theta) , g(\theta)} {\displaystyle\int{\Theta} f(x \mid \vartheta) , g(\vartheta) , d\vartheta} \ & = \underset{\theta}{\operatorname{arg,max}} \ f(x \mid \theta) , g(\theta). \end{align} !

The denominator of the posterior density (the marginal likelihood of the model) is always positive and does not depend on \theta and therefore plays no role in the optimization. Observe that the MAP estimate of \theta coincides with the ML estimate when the prior g is uniform (i.e., g is a constant function), which occurs whenever the prior distribution is taken as the reference measure, as is typical in function-space applications.

When the loss function is of the form

: L(\theta, a) = \begin{cases} 0, & \text{if } |a-\theta| 1, & \text{otherwise}, \ \end{cases}

as c goes to 0, the Bayes estimator approaches the MAP estimator, provided that the distribution of \theta is quasi-concave. But generally a MAP estimator is not a Bayes estimator unless \theta is discrete.

Computation

MAP estimates can be computed in several ways:

  1. Analytically, when the mode(s) of the posterior density 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

Limitations

While only mild conditions are required for MAP estimation to be a limiting case of Bayes estimation (under the 0–1 loss function), it is not representative of Bayesian methods in general. This is because MAP estimates are point estimates, and depend on the arbitrary choice of reference measure, 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 for a continuous posterior distribution there is no loss function which suggests the MAP is the optimal point estimator. In addition, the posterior density may often not have a simple analytic form: in this case, the distribution can be simulated using Markov chain Monte Carlo techniques, while optimization to find the mode(s) of the density may be difficult or impossible.

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, especially in many dimensions.

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. In contrast, Bayesian posterior expectations are invariant under reparameterization.

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 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 h_1, h_2 and h_3 with posteriors 0.4, 0.3 and 0.3 respectively. Suppose given a new instance, x, h_1 classifies it as positive, whereas the other two classify it as negative. Using the MAP estimate for the correct classifier h_1, x is classified as positive, whereas the Bayes estimators would average over all hypotheses and classify x as negative.

Example

Suppose that we are given a sequence (x_1, \dots, x_n) of IID N(\mu,\sigma_v^2 ) random variables and a prior distribution of \mu is given by N(\mu_0,\sigma_m^2 ). We wish to find the MAP estimate of \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

:g(\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 \mu:

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

:\hat{\mu}\mathrm{MAP} = \frac{\sigma_m^2,n}{\sigma_m^2 ,n+ \sigma_v^2 } \left(\frac{1}{n} \sum{j=1}^n x_j \right) + \frac{\sigma_v^2}{\sigma_m^2 ,n+ \sigma_v^2 } ,\mu_0 =\frac{\sigma_m^2\left(\sum_{j=1}^n x_j\right) + \sigma_v^2 ,\mu_0}{\sigma_m^2,n + \sigma_v^2 }.

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

The case of \sigma_m \to \infty is called a non-informative prior and leads to an improper probability distribution; in this case \hat{\mu}\mathrm{MAP} \to \hat{\mu}\mathrm{MLE}.

References

References

  1. (2018-01-30). "Maximum a posteriori estimators as a limit of Bayes estimators". Mathematical Programming.
  2. (2012). "Machine learning : a probabilistic perspective". MIT Press.
  3. (2005). "Essentials of Statistical Inference". Cambridge University Press.
Info: Wikipedia Source

This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page.

Want to explore this topic further?

Ask Mako anything about Maximum a posteriori estimation — get instant answers, deeper analysis, and related topics.

Research with Mako

Free with your Surf account

Content sourced from Wikipedia, available under CC BY-SA 4.0.

This content may have been generated or modified by AI. CloudSurf Software LLC is not responsible for the accuracy, completeness, or reliability of AI-generated content. Always verify important information from primary sources.

Report