13
$\begingroup$

Given the formula for MAP estimation of a parameter MAP parameter estimation Why is a MCMC (or similar) approach needed, couldn't I just take the derivative, set it to zero and then solve for the parameter?

$\endgroup$
  • $\begingroup$ Great question! $\endgroup$ – user46925 Mar 12 '16 at 15:19
5
$\begingroup$

If you know which family your posterior is from and if finding the derivative of that distribution is analytically feasible, that is correct.

However, when you use MCMC, you are likely not going to be in that type of situation. MCMC is made for situations in which you have no clear analytical notion of how your posterior looks like.

| cite | improve this answer | |
$\endgroup$
  • 3
    $\begingroup$ I think this is slightly misleading: MCMC is typically not used for finding the MAP estimator (outside special cases like an MCEM algorithm). $\endgroup$ – Cliff AB Aug 26 '15 at 17:02
  • 1
    $\begingroup$ I do not disagree with you in principle. But, MCMC can be and is used to simulate the posterior distribution. And once you have done that, you can sure find the mode of that distribution, aka the MAP. Which is, I believe, what the OP had in mind, so I am not quite sure why my answer would be misleading. $\endgroup$ – Christoph Hanck Aug 27 '15 at 5:04
  • $\begingroup$ Yes, however, is MCMC the method of choice when dealing with MAP if there is no analytical way to optimize the parameter? $\endgroup$ – Dänu Aug 27 '15 at 13:39
  • 3
    $\begingroup$ I've never heard of using simple MCMC to find the mode of the posterior distribution (technically, it could be done, but this is extremely inefficient). Since we typically can evaluate a function that is proportional to the posterior distribution, maximizing this will be equivalent to maximizing the posterior distribution. Out of the box optimizers will work just as well on this as any frequentist likelihood problem (which is to say, sometimes you will need to specialize them). $\endgroup$ – Cliff AB Aug 27 '15 at 18:11
  • $\begingroup$ @Dänu You probably don't want to use MCMC (to be pedantic, a Markov chain) to find maxima. An optimization algorithm should work better. $\endgroup$ – jtobin Aug 27 '15 at 19:10
10
$\begingroup$

Most posteriors prove to be difficult to optimize analytically (i.e. by taking a gradient and setting it equal to zero), and you'll need to resort to some numerical optimization algorithm to do MAP.

As an aside: MCMC is unrelated to MAP.

MAP - for maximum a posteriori - refers to finding a local maximum of something proportional to a posterior density and using the corresponding parameter values as estimates. It is defined as

$$ \hat{\theta}_{MAP} = \text{argmax}_{\theta} \, p(\theta \, | \, D) $$

MCMC is typically used to approximate expectations over something proportional to a probability density. In the case of a posterior, that's

$$ \hat{\theta}_{MCMC} = n^{-1} \sum_{i=1}^{n} \theta^{0}_{i} \approx \int_{\Theta}\theta \, p(\theta \, | \, D)d\theta $$

where $\{\theta^{0}_{i}\}^{n}_{i=1}$ is a collection of parameter space positions visited by a suitable Markov chain. In general, $\hat{\theta}_{MAP} \neq \hat{\theta}_{MCMC}$ in any meaningful sense.

The crux is that MAP involves optimization, while MCMC is based around sampling.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ You state that posteriors prove to be difficult to optimize analytically, which is the case in MAP. So is MAP only possible if the posterior can be optimized analytically and if this is not the case one has to resort (for example) to an MCMC approach? $\endgroup$ – Dänu Aug 27 '15 at 13:04
  • 2
    $\begingroup$ No, instead of coming with the analytical solution, one can use an iterative algorithm to come up with the solution (i.e. if the log posterior is concave, you can use Newton's Method, for example). $\endgroup$ – Cliff AB Aug 27 '15 at 18:13
  • 2
    $\begingroup$ MAP refers to finding parameter values that (locally) maximize a posterior. It doesn't matter how one gets those parameter values: solving for maxima analytically, using a numerical routine, automatic differentiation, etc. $\endgroup$ – jtobin Aug 27 '15 at 19:00
1
$\begingroup$

MCMC is not needed (or suggested) in order to compute a MAP estimate. In general, you won't be able to solve for the root of the MAP objective's derivative. However, you can use numerical optimization to approximately maximize the objective. As noted, MCMC is a sampling method, whereas MAP estimation is an optimization problem. MAP estimation only requires us to be able to evaluate the (unnormalized) posterior distribution at a given $\theta$, and only gives us one piece of information about that posterior. By approximately sampling an intractable posterior, MCMC methods allow us to learn all information about the posterior distribution.

| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.