ArticleslgStudy

mathematics

Maximum a posteriori estimation

Maximum a posteriori estimation is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Maximum a posteriori estimation rather than just read about it. In short: In Bayesian statistics, the maximum a posteriori (MAP) estimate of an unknown quantity is the mode of the posterior density. The MAP can be used to obtain a point estimate of an unobserved quantity on the basis of empirical data.

Maximum a posteriori estimation — main illustration
Maximum a posteriori estimation — illustration

Key takeaways

  • Maximum a posteriori estimation belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Maximum a posteriori estimation to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Maximum a posteriori estimation from memory before moving on to harder problems.

Reference excerpt

In Bayesian statistics, the maximum a posteriori (MAP) estimate of an unknown quantity is the mode of the posterior density. 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.

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

θ↦f(x∣θ) is known as the likelihood function and the estimate:

θ̂MLE(x)=argmaxθ f(x∣θ) is the maximum likelihood estimate of θ. Now assume that a prior distribution g 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:

θ↦f(θ∣x)=f(x∣θ)g(θ)∫Θf(x∣ϑ)g(ϑ)dϑ where g is density function of θ, Θ is the domain of g. The method of maximum a posteriori estimation then estimates θ as the mode of the posterior density of this random variable:

θ̂MAP(x)=argmaxθ f(θ∣x)=argmaxθ f(x∣θ)g(θ)∫Θf(x∣ϑ)g(ϑ)dϑ=argmaxθ f(x∣θ)g(θ). The denominator of the posterior density (the marginal likelihood of the model) 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 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. In the context of Bayes estimators, the MAP can be recovered as the minimizer of the Bayes risk with risk function

L(θ,a)={0,if |a−θ|<c,1,otherwise, in the limit as c goes to 0, provided that the distribution of θ is quasi-concave. Generally, however, a MAP estimator is not a Bayes estimator unless θ is discrete.

Computation MAP estimates can be computed in several ways:

Analytically, when the mode(s) 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 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 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 h1, h2 and h3 with posteriors 0.4, 0.3 and 0.3 respectively. Suppose given a new instance, x, h1 classifies it as positive, whereas the other two classify it as negative. Using the MAP estimate for the correct classifier h1, 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 (x1,…,xn) of IID N(μ,σv2) random variables and a prior distribution of μ is given by N(μ0,σm2). 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

g(μ)f(x∣μ)=π(μ)L(μ)=12πσmexp⁡(−12(μ−μ0σm)2)∏j=1n12πσvexp⁡(−12(xj−μσv)2), which is equivalent to minimizing the following function of μ:

∑j=1n(xj−μσv)2+(μ−μ0σm)2. Thus, we see that the MAP estimator for μ is given by

μ̂MAP=σm2nσm2n+σv2(1n∑j=1nxj)+σv2σm2n+σv2μ0=σm2(∑j=1nxj)+σv2μ0σm2n+σv2. 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→∞ is called a non-informative prior and leads to an improper probability distribution; in this case μ̂MAP→μ̂MLE.

References

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.

Illustrations

Maximum a posteriori estimation: An example of a density of a bimodal distribution in which the highest mode is uncharacteristic of the majority of the distribution
An example of a density of a bimodal distribution in which the highest mode is uncharacteristic of the majority of the distribution

Worked examples

Example 1 — a first encounter with Maximum a posteriori estimation

Start with the simplest possible case. Write down what Maximum a posteriori estimation claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Maximum a posteriori estimation before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Maximum a posteriori estimation ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Maximum a posteriori estimation

In research
Maximum a posteriori estimation appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Maximum a posteriori estimation in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Maximum a posteriori estimation is common in secondary-school and first-year university syllabi. It links to neighbouring topics A priori, Bayesian estimation, Logic and statistics, so understanding it makes those chapters shorter.
In everyday life
Look for Maximum a posteriori estimation outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Maximum a posteriori estimation” →

How to study Maximum a posteriori estimation in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Maximum a posteriori estimation means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Maximum a posteriori estimation out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Maximum a posteriori estimation in simple terms?

In Bayesian statistics, the maximum a posteriori (MAP) estimate of an unknown quantity is the mode of the posterior density. The MAP can be used to obtain a point estimate of an unobserved quantity on the basis of empirical data.

Why does Maximum a posteriori estimation matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Maximum a posteriori estimation?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Maximum a posteriori estimation.

Tags

  • A priori
  • Bayesian estimation
  • Logic and statistics

Keep exploring