Is there an equivalent argument to NUTS target_accept for Metropolis sampling? Apologies if this is obvious and I’ve missed the documentation. My goal is to be able to manually tune the acceptance ratio in an MH model.
Many thanks
I dont think we have such option implemented, you will need to modify the code yourself here:
def tune(scale, acc_rate):
"""
Tunes the scaling parameter for the proposal distribution
according to the acceptance rate over the last tune_interval:
Rate Variance adaptation
---- -------------------
<0.001 x 0.1
<0.05 x 0.5
<0.2 x 0.9
>0.5 x 1.1
>0.75 x 2
>0.95 x 10
"""
# Switch statement
if acc_rate < 0.001:
# reduce by 90 percent
scale *= 0.1
This file has been truncated. show original
and here:
Thanks, I’ll look at this. Can you advise on any similar strategies reduce the acceptance parameter (accept a wider range of solutions)? (I’m new to MCMC/PyMC so there might be a better way to get to where I’d like to go…)
In general this is a difficult question for Metropolis, you can have a look at these 2 related discussions:
I noticed that in metropolis.py there is this code in the tune function:
# Switch statement
if acc_rate < 0.001:
# reduce by 90 percent
scale *= 0.1
elif acc_rate < 0.05:
# reduce by 50 percent
scale *= 0.5
elif acc_rate < 0.2:
# reduce by ten percent
scale *= 0.9
elif acc_rate > 0.95:
# increase by factor of ten
scale *= 10.0
elif acc_rate > 0.75:
# increase by double
scale *= 2.0
elif acc_rate > 0.5:
# increase by ten percent
scale *= 1.1
Whe…
I’m using PyMC’s Metropolis to sample from a 200-dimensional probability distribution and I want it to converge faster by setting the scale of the proposal distribution “just right” . Here’s what I did:
Lots of trial and error and got an estimation of the variance of the target distribution.
I used it to derive a proposal distribution with balanced scales among dimensions. (So the proposal distribution mimics the proportions of the target distribution).
I calculated the radius of the typical se…
For NUTS and HMC, I think the value is empirically works fine, but there is also no theory behind it.