Skip to content
Glacius
StatisticsConcept reference

MAP estimation

A posterior mode maximizes likelihood times prior over the supplied candidate set; all tied maxima are modes.

On this page 9 sections
  1. Overview
  2. Understand the idea
  3. For prior (0.6,0.4) and likelihood (0.2,0.5), weights are (0.12,0.2)
  4. Keep all candidates tied at the largest weight
  5. MAP reports a best candidate, not the full uncertainty over candidates
  6. Key takeaway
  7. Further questions
  8. Sources & further reading
  9. Concept connections

01Understand the idea#

Maximum a posteriori, or MAP, estimation selects the parameter candidate with the greatest posterior probability. It combines the likelihood of the observed data with a prior preference over candidates. The candidate favored by data alone need not win after that prior is included.

The prior favors A, and likelihood favors C. Multiply their matching values: weights are 0.1,0.15,0.12. B has the largest posterior weight.

Candidates A,B,C have prior masses .5,.3,.2 and data likelihoods .2,.5,.6. Their products are .1,.15,.12. B has the greatest product, even though A has the largest prior and C the largest likelihood.Candidates A,B,C have prior masses .5,.3,.2 and data likelihoods .2,.5,.6. Their products are .1,.15,.12. B has the greatest product, even though A has the largest prior and C the largest likelihood.
Figure 1Candidates A,B,C have prior masses .5,.3,.2 and data likelihoods .2,.5,.6. Their products are .1,.15,.12. B has the greatest product, even though A has the largest prior and C the largest likelihood.
Link to this figure ↗Download SVGDownload PNG

Every posterior mass has the same positive evidence denominator. For candidate ii, multiply its likelihood LiL_i by prior πi\pi_i. Choose every candidate tied at the largest weight.

wi=Liπiw_i=L_i\pi_i

For candidates A, B, C with prior (0.5,0.3,0.2)(0.5,0.3,0.2) and likelihood (0.2,0.5,0.6)(0.2,0.5,0.6), multiply matching pairs to get (0.1,0.15,0.12)(0.1,0.15,0.12). B has the greatest weight. All posterior masses would share the same positive normalization constant, so normalization is unnecessary if you only need the winner.

Check your reasoning

Candidates (A,B,C). Prior (0.3,0.4,0.3)(0.3,0.4,0.3); likelihood (0.2,0.4,0.5)(0.2,0.4,0.5). Posterior mode?

  1. AA
  2. BB
  3. CC
Show answer and explanation
B

(0.06,0.16,0.15)(0.06,0.16,0.15).

02For prior (0.6,0.4) and likelihood (0.2,0.5), weights are (0.12,0.2)#

For prior (0.6,0.4)(0.6,0.4) and likelihood (0.2,0.5)(0.2,0.5), weights are (0.12,0.2)(0.12,0.2). The second candidate wins even though its prior is smaller. Comparing just one input can change the answer.

Check your reasoning

Candidates (A,B,C). Prior (0.4,0.2,0.4)(0.4,0.2,0.4); likelihood (0.2,0.4,0.1)(0.2,0.4,0.1). Claim: only A wins. Give all modes.

  1. AA and B
  2. BA
  3. CA and C
Show answer and explanation
A and B

(0.08,0.08,0.04)(0.08,0.08,0.04).

03Keep all candidates tied at the largest weight#

Keep all candidates tied at the largest weight. A zero prior produces zero posterior weight when evidence is positive. Equal nonzero priors preserve likelihood ordering; unequal priors can change it.

Check your reasoning

Ordered iid Bernoulli sample (0,1,0)(0,1,0), P(1)=pP(1)=p. p=(0.2,0.5,0.8)p=(0.2,0.5,0.8); prior (0.4,0.4,0.2)(0.4,0.4,0.2). Posterior mode?

  1. A0.5
  2. B0.8
  3. C0.2
Show answer and explanation
0.2

(0.0512,0.05,0.0064)(0.0512,0.05,0.0064)

04MAP reports a best candidate, not the full uncertainty over candidates#

MAP reports a best candidate, not the full uncertainty over candidates. Preserve all tied maxima when the task asks for every posterior mode. To answer a probability question about several candidate settings, retain and normalize the full grid instead.

Key takeaway

Multiply each candidate’s likelihood by its prior and compare the weights. Keep every tied maximum.

  • Select a posterior mode from a supplied likelihood and prior.

Further questions

How do we recover the whole posterior distribution?
Divide every candidate weight by their positive total. This preserves the maximum while retaining probability on the other candidates.

Sources & further reading

  1. [1]
  2. [2]

Reference this concept

Link to this page, a section, or an individual figure.

Glacius. “MAP estimation.” Math behind ML. /learn/s-map