0

I wanted to learn about MAP optimization im pymc. I got the following posterior distribution of lambda after sampling using mcmc enter image description here

Clearly, the posterior is maximum at lambda = 0.20 and the 95% intervals are [0.17, 0.24] (please correct me if I am wrong)

As far as I know MAP gives a point estimate (the value of lambda which has max posterior probability ), but when I run MAP twice, I get different values which should not be the case.

I am printing the values of lambda before nd after using map in 2 execution of d same program.

Before using MAP 0.200091865615 After using MAP 0.197584715205

Before using MAP 1.28960939539 After using MAP 2.70871770586

Can someone explain what is going on and how to get rid of this issue ?

turing
  • 577
  • 1
  • 4
  • 12

1 Answers1

0

Could be convergence issues with the optimizer at the second starting value. Can you try a different optimizer? For example:

MAP(method='fmin_powell')
Chris Fonnesbeck
  • 4,143
  • 4
  • 29
  • 30
  • But how do I know in advance that I will have to use some other optimizer ? I already had the posterior, hence I could verify here but that might not be the case everytime. – turing Jun 13 '14 at 03:19
  • You don't. The art behind optimization is being able to choose a reasonable starting value. You can do this in PyMC by setting the `value=` argument (otherwise it uses a random draw). – Chris Fonnesbeck Jun 14 '14 at 03:54