Maximum a posteriori estimation
An estimation procedure that is often claimed to be part of Bayesian statistics is the maximum a posteriori '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 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 on the basis of observations. Let be the sampling distribution of, so that is the probability of when the underlying population parameter is. Then the function:is known as the likelihood function and the estimate:
is the maximum likelihood estimate of.
Now assume that a prior distribution over exists. This allows us to treat as a random variable as in Bayesian statistics. We can calculate the posterior density of using Bayes' theorem:
where is density function of, is the domain of.
The method of maximum a posteriori estimation then estimates as the mode of the posterior density of this random variable:
The denominator of the posterior density is always positive and does not depend on and therefore plays no role in the optimization. Observe that the MAP estimate of coincides with the ML estimate when the prior is uniform, 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
as goes to 0, the Bayes estimator approaches the MAP estimator, provided that the distribution of is quasi-concave. But generally a MAP estimator is not a Bayes estimator unless is discrete.
Computation
MAP estimates can be computed in several ways:- Analytically, when the mode of the posterior density can be given in closed form. This is the case when conjugate priors are used.
- 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.
- Via a modification of an expectation-maximization algorithm. This does not require derivatives of the posterior density.
- Via a Monte Carlo method using simulated annealing
Limitations
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, nor in some cases even possible. 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 and using a MAP estimate, consider the case where there is a need to classify inputs as either positive or negative. Suppose there are just three possible hypotheses about the correct method of classification, and with posteriors 0.4, 0.3 and 0.3 respectively. Suppose given a new instance,, classifies it as positive, whereas the other two classify it as negative. Using the MAP estimate for the correct classifier, is classified as positive, whereas the Bayes estimators would average over all hypotheses and classify as negative.
Example
Suppose that we are given a sequence of IID random variables and a prior distribution of is given by . We wish to find the MAP estimate of. 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
which is equivalent to minimizing the following function of :
Thus, we see that the MAP estimator for μ is given by
which turns out to be a linear interpolation between the prior mean and the sample mean weighted by their respective covariances.
The case of is called a non-informative prior and leads to an improper probability distribution; in this case