Citation for basic Metropolis sampler


It appears that the basic Metropolis sampler used in PyMC3 is the adaptive Metropolis algorithm specified in Haario et al. 2001 ( Is this the case?


I don’t think the algorithm specified in Haario et al. (2001) that you mention is used in PyMC3, since that algorithm is Adaptive Metropolis (AM), and I had asked here why there was no adaptive Metropolis in PyMC, and you can see the answers in that thread.

There is no ‘true adaptation’ for the common Metropolis algorithm in the sense of AM in PyMC if I am correct, since there is no covariance adaptation of any form, be it using the empirical factor of 2.38^2/d of Gelman et al. (1996) for the update of the covariance, or other formulas targeting directly an acceptance ratio like in Vihola (2012). (See also this question on that matter)

The only ‘adaptation’ for Metropolis happening in PyMC is used is in the burn-in phase, with arbitrary values changing the scale of the proposal, you can see it in the question I had asked here.

If you use other samplers, like NUTS, then it is another story, but you need the gradient of your posterior.

1 Like

Thanks for the information! I had noticed the proposal tuning in the code but I didn’t realize that was only for the burn-in.