# Metropolis equivalent to NUTS target\_accept?

**URL:** <https://discourse.pymc.io/t/metropolis-equivalent-to-nuts-target-accept/1668>\
**Category:** Questions\
**Created:** [August 7, 2018, 11:10am UTC](https://discourse.pymc.io/t/metropolis-equivalent-to-nuts-target-accept/1668 "2018-08-07T11:10:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![richardUK](https://avatars.discourse-cdn.com/v4/letter/r/6de8d8/32.png) [@richardUK](https://discourse.pymc.io/u/richardUK)\
**Post date:** [August 7, 2018, 11:10am UTC](https://discourse.pymc.io/t/metropolis-equivalent-to-nuts-target-accept/1668/1 "2018-08-07T11:10:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![junpenglao](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/junpenglao/32/8_2.png) [@junpenglao](https://discourse.pymc.io/u/junpenglao)\
**Post date:** [August 7, 2018, 11:44am UTC](https://discourse.pymc.io/t/metropolis-equivalent-to-nuts-target-accept/1668/2 "2018-08-07T11:44:44Z")

</div>

I dont think we have such option implemented, you will need to modify the code yourself here:

> <https://github.com/pymc-devs/pymc3/blob/8a55b69673e72cb5c05a0fca81a5a0cabd017e6f/pymc3/step_methods/metropolis.py#L180-L216>

  
and here:  

> <https://github.com/pymc-devs/pymc3/blob/8a55b69673e72cb5c05a0fca81a5a0cabd017e6f/pymc3/step_methods/metropolis.py#L140-L146>

---

<div class="post-metadata">

**Author:** ![richardUK](https://avatars.discourse-cdn.com/v4/letter/r/6de8d8/32.png) [@richardUK](https://discourse.pymc.io/u/richardUK)\
**Post date:** [August 7, 2018, 2:00pm UTC](https://discourse.pymc.io/t/metropolis-equivalent-to-nuts-target-accept/1668/3 "2018-08-07T14:00:18Z")

</div>

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…)

---

<div class="post-metadata">

**Author:** ![junpenglao](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/junpenglao/32/8_2.png) [@junpenglao](https://discourse.pymc.io/u/junpenglao)\
**Post date:** [August 7, 2018, 2:49pm UTC](https://discourse.pymc.io/t/metropolis-equivalent-to-nuts-target-accept/1668/4 "2018-08-07T14:49:51Z")

</div>

In general this is a difficult question for Metropolis, you can have a look at these 2 related discussions:

> [@Where do the automatic tuning values in metropolis.py come from?](https://discourse.pymc.io/t/where-do-the-automatic-tuning-values-in-metropolis-py-come-from/631):
>
> 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…

> [@Metropolis: ideal balance between slow-mixing and high rejection rate?](https://discourse.pymc.io/t/metropolis-ideal-balance-between-slow-mixing-and-high-rejection-rate/1205):
>
> 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”](https://en.wikipedia.org/wiki/Metropolis%E2%80%93Hastings_algorithm#Intuition). 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.
