Markov Chain Monte Carlo – Can Proposal Distribution for Metropolis-Hastings Be Conditioned on Other Variables?

gibbsmarkov-chain-montecarlometropolis-hastings

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.

Best Answer

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)$.