Misplaced Pages

Maximum a posteriori estimation

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
(Redirected from Maximum a posteriori estimate) Method of estimating the parameters of a statistical model
This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "Maximum a posteriori estimation" – news · newspapers · books · scholar · JSTOR (September 2011) (Learn how and when to remove this message)
Part of a series on
Bayesian statistics
Posterior = Likelihood × Prior ÷ Evidence
Background
Model building
Posterior approximation
Estimators
Evidence approximation
Model evaluation

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 θ {\displaystyle \theta } on the basis of observations x {\displaystyle x} . Let f {\displaystyle f} be the sampling distribution of x {\displaystyle x} , so that f ( x θ ) {\displaystyle f(x\mid \theta )} is the probability of x {\displaystyle x} when the underlying population parameter is θ {\displaystyle \theta } . Then the function:

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

is known as the likelihood function and the estimate:

θ ^ M L E ( x ) = a r g m a x θ   f ( x θ ) {\displaystyle {\hat {\theta }}_{\mathrm {MLE} }(x)={\underset {\theta }{\operatorname {arg\,max} }}\ f(x\mid \theta )\!}

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

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

θ f ( θ x ) = f ( x θ ) g ( θ ) Θ f ( x ϑ ) g ( ϑ ) d ϑ {\displaystyle \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 {\displaystyle g} is density function of θ {\displaystyle \theta } , Θ {\displaystyle \Theta } is the domain of g {\displaystyle g} .

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

θ ^ M A P ( x ) = a r g m a x θ   f ( θ x ) = a r g m a x θ   f ( x θ ) g ( θ ) Θ f ( x ϑ ) g ( ϑ ) d ϑ = a r g m a x θ   f ( x θ ) g ( θ ) . {\displaystyle {\begin{aligned}{\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{aligned}}\!}

The denominator of the posterior density (the marginal likelihood of the model) is always positive and 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 g {\displaystyle g} is uniform (i.e., g {\displaystyle 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 ( θ , a ) = { 0 , if  | a θ | < c , 1 , otherwise , {\displaystyle L(\theta ,a)={\begin{cases}0,&{\text{if }}|a-\theta |<c,\\1,&{\text{otherwise}},\\\end{cases}}}

as c {\displaystyle c} goes to 0, the Bayes estimator approaches the MAP estimator, provided that the distribution of θ {\displaystyle \theta } is quasi-concave. 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 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.

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, 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 {\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 h 1 {\displaystyle h_{1}} , h 2 {\displaystyle h_{2}} and h 3 {\displaystyle h_{3}} with posteriors 0.4, 0.3 and 0.3 respectively. Suppose given a new instance, x {\displaystyle x} , h 1 {\displaystyle h_{1}} classifies it as positive, whereas the other two classify it as negative. Using the MAP estimate for the correct classifier h 1 {\displaystyle h_{1}} , x {\displaystyle x} is classified as positive, whereas the Bayes estimators would average over all hypotheses and classify x {\displaystyle x} as negative.

Example

Suppose that we are given a sequence ( x 1 , , x n ) {\displaystyle (x_{1},\dots ,x_{n})} of IID N ( μ , σ v 2 ) {\displaystyle N(\mu ,\sigma _{v}^{2})} random variables and a prior distribution of μ {\displaystyle \mu } is given by N ( μ 0 , σ m 2 ) {\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

g ( μ ) f ( x μ ) = π ( μ ) L ( μ ) = 1 2 π σ m exp ( 1 2 ( μ μ 0 σ m ) 2 ) j = 1 n 1 2 π σ v exp ( 1 2 ( x j μ σ v ) 2 ) , {\displaystyle 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 μ {\displaystyle \mu } :

j = 1 n ( x j μ σ v ) 2 + ( μ μ 0 σ m ) 2 . {\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

μ ^ M A P = σ m 2 n σ m 2 n + σ v 2 ( 1 n j = 1 n x j ) + σ v 2 σ m 2 n + σ v 2 μ 0 = σ m 2 ( j = 1 n x j ) + σ v 2 μ 0 σ m 2 n + σ v 2 . {\displaystyle {\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 σ m {\displaystyle \sigma _{m}\to \infty } is called a non-informative prior and leads to an improper probability distribution; in this case μ ^ M A P μ ^ M L E . {\displaystyle {\hat {\mu }}_{\mathrm {MAP} }\to {\hat {\mu }}_{\mathrm {MLE} }.}

References

  1. ^ Bassett, Robert; Deride, Julio (2018-01-30). "Maximum a posteriori estimators as a limit of Bayes estimators". Mathematical Programming: 1–16. arXiv:1611.05917. doi:10.1007/s10107-018-1241-0. ISSN 0025-5610.
  2. Murphy, Kevin P. (2012). Machine learning : a probabilistic perspective. Cambridge, Massachusetts: MIT Press. pp. 151–152. ISBN 978-0-262-01802-9.
  3. ^ Young, G. A.; Smith, R. L. (2005). Essentials of Statistical Inference. Cambridge Series in Statistical and Probabilistic Mathematics. Cambridge: Cambridge University Press. ISBN 978-0-521-83971-6.
  • DeGroot, M. (1970). Optimal Statistical Decisions. McGraw-Hill. ISBN 0-07-016242-5.
  • Sorenson, Harold W. (1980). Parameter Estimation: Principles and Problems. Marcel Dekker. ISBN 0-8247-6987-2.
  • Hald, Anders (2007). "Gauss's Derivation of the Normal Distribution and the Method of Least Squares, 1809". A History of Parametric Statistical Inference from Bernoulli to Fisher, 1713–1935. New York: Springer. pp. 55–61. ISBN 978-0-387-46409-1.
Statistics
Descriptive statistics
Continuous data
Center
Dispersion
Shape
Count data
Summary tables
Dependence
Graphics
Data collection
Study design
Survey methodology
Controlled experiments
Adaptive designs
Observational studies
Statistical inference
Statistical theory
Frequentist inference
Point estimation
Interval estimation
Testing hypotheses
Parametric tests
Specific tests
Goodness of fit
Rank statistics
Bayesian inference
Correlation
Regression analysis
Linear regression
Non-standard predictors
Generalized linear model
Partition of variance
Categorical / Multivariate / Time-series / Survival analysis
Categorical
Multivariate
Time-series
General
Specific tests
Time domain
Frequency domain
Survival
Survival function
Hazard function
Test
Applications
Biostatistics
Engineering statistics
Social statistics
Spatial statistics
Categories: