# Can the proposal distribution for Metropolis-Hastings within Gibbs be conditioned on other variabless?

I am drawing samples from my posterior, $$P(x,y|z)$$, using Gibbs sampling. When I sample $$x$$, I use a Metropolis-Hastings step. My question is whether I am allowed to use a proposal distribution for $$x'$$ that is conditioned on the current sample of $$y$$ ($$Q(x'|y)$$)?

My intuition tells me that this is reasonable and the acceptance probability, $$A = \frac{P(x'|y,z)Q(x|y)}{P(x|y,z)Q(x'|y)}$$ does not seem to diverge. I would just like to make sure that this does not break my sampler for reasons that I am missing.

• Would an example of what you'd like to do be a proposal distribution centered at the current sample? Jun 25, 2022 at 22:21
• @jbowman Specifically in my case, I am sampling a chain of variables. My parameter $x$ is the position of a particle at time $n$. The $y$ parameter above is the positions at all time points except $n$. I want to propose $x$ with a distribution centered at the mean of the other positions. Jun 26, 2022 at 0:57
• My intuition tells me that's mathematically OK, but you may have to take care that your proposal distribution has fat enough tails so that you won't wind up sampling from just the center of the posterior distribution because your proposal is anchored very near there. Jun 26, 2022 at 2:10

The mathematical validation of this Metropolis-within-Gibbs step is that $$P(\cdot|y,z)$$ is stationary under that move. This conditional distribution sets $$y$$ and $$z$$ as given or fixed and hence the proposal $$Q(\cdot|y)$$ can depend on them as well. This acceptance probability $$A(x,x') = \frac{P(x'|y,z)Q(x|y)}{P(x|y,z)Q(x'|y)}\wedge 1$$ is preserving the stationarity of $$P(\cdot|y,z)$$.