Does Metropolis-Hastings work with the log of the proposal and the density to be sampled from? That is, say we want to sample from a density $\pi(x)$, using a proposal $q(x|x^{old})$, will the Metropolis-Hastings work with $\log(\pi(x))$ and $\log(q(x|x^{old}))$ as well?
When constructing a Gibbs sampler, we often encounter full conditional distributions that are non-conjugate. Techniques to sample from them include ARS,1,2 ARMS,3 and Slice sampling.4 These techniques have the convenient feature that they can take the log of a density to be sampled from. They are technically Metropolis-Hastings samplers, so there are cases where my question will be answered in the affirmative. But is this a general feature of the Metropolis-Hastings algorithm?
The reason for my question is that you often store the log of the density when designing a Gibbs sampler, especially when using an object-oriented language and one of the three samplers mentioned above. If you have $\log( \pi(x) )$ stored, you could take $e^{ \log(\pi(x)) } = \pi(x)$ and use Metropolis-Hastings, but that can create issues with numerical overflow and underflow.
I have been unable to find a reference that explains or provides a proof to this question.
EDIT:
I didn't mean to ask whether I can sample from $\log(\pi(x) )$, since that makes no sense. My question was whether the Metropolis-Hastings can work if I pass it $\log(\pi(x) ) $. That is, is there a way to construct the algorithm that only uses the "better behaved" $\log(\pi(x) ) )$, rather than $\pi(x)$? The latter is usually a product of multiple other densities, and it can get really big really quick. Sums of log-densities are easier to use in algorithms than products of densities.
References:
1Gilks, W., Wild, P.: Adaptive Rejection Sampling for Gibbs sampling, Applied Statistics 41(2), 337–348, 1992
2Gilks, W.: Derivative-free Adaptive rejection sampling for Gibbs sampling, Baysian Statistics 4, Oxford University Press, Oxford, 641–649, Eds: Bernardo, J., Berger, j., Dawid, A., Smith, A., 1992
3Gilks, W., Best, N., Tan, K.: Adaptive Rejection Metropolis Sampling within Gibbs sampling, Applied Statistics 44(4), 455–472, 1995
4Neal, Radford M: Slice sampling, Annals of Statistics 31(3), 705–741, 2003