According to the sources I've read, Gibbs sampling doesn't really tell you how to sample... it's just divide-and-conquer: you still need to sample each variable from its full conditional
( Read more... )
I'm doing good old Metropolis-Hastings, with a proposal that makes its trajectory resemble Gibbs: it randomly chooses one variable to modify, and then randomly chooses a value for that variable.
Another way to look at it then is that you are doing Gibbs sampling, but you're using a fancy sampler (MH) to sample from the (complicated) conditional distribution for that variable.
I can easily compute the posterior. In traditional MCMC, I think you would weight the samples by how often they appear. But doesn't it make more sense to directly compute the posterior in all sampled models?Are you talking about running your sampler, then assigning a weight to all of your posterior samples based on the posterior? Don't do this---if you do that, you'll be representing a density which is your original density squared. You can try this for yourself with a simpler model. Draw a whole bunch of normal samples. If you took their histogram, you'd get something like a normal distribution back. Now weight the samples by the normal distribution PDF value
( ... )
<< Another way to look at it then is that you are doing Gibbs sampling, but you're using a fancy sampler (MH) to sample from the (complicated) conditional distribution for that variable. >>
(namely the 1D full conditional for that variable)
yeah, I see what you're saying! And it would be true, except for a minor technicality.
The way I implemented this, if the MH move is rejected, most of the time the proposal will be changing a different variable. So we're not sampling from the 1D full conditional.
<< Are you talking about running your sampler, then assigning a weight to all of your posterior samples based on the posterior? Don't do this---if you do that, you'll be representing a density which is your original density squared. >>
if the posterior samples have lots of duplication (i.e. states are visited multiple times), and I remove the duplication, I'm effectively normalizing, i.e. dividing by the posterior density.
I would think that it's a better idea to just preserve the duplicates. If it really bothers you, then remove the duplicates and weight the samples by how many duplicates there were. Otherwise, be very careful with reweighting schemes---you can easily abandon the density you were trying to represent.
<< No, I think you are still sampling from the variable's conditional even if it rejects.
Think about it like this. Instead of running only a single MH iteration per variable, you could run multiple MH iterations per variable. Some of those iterations would reject, some would accept. >>
hopefully... but anyway, it's not what I'm doing.
<< Nevertheless, the collection of samples you would get, some of which are repeated ... >>
hang on, when the proposed move is rejected, you don't get the current state again, do you? My sources were ambiguous about this.
<< ..., would approximate the conditional distribution of the variable. (Think again in terms of histograms if that helps.) >>
sure.
<< but many MCMC approaches often discard the first few samples to allow the sampler to "burn in", i.e. converge on an area of high probability from a less likely initialization state. (As you probably know.) It might be better for you to run a few iterations of the sampler per variable as you perform your Gibbs sampling; that way you can be
( ... )
Comments 13
Reply
Another way to look at it then is that you are doing Gibbs sampling, but you're using a fancy sampler (MH) to sample from the (complicated) conditional distribution for that variable.
I can easily compute the posterior. In traditional MCMC, I think you would weight the samples by how often they appear. But doesn't it make more sense to directly compute the posterior in all sampled models?Are you talking about running your sampler, then assigning a weight to all of your posterior samples based on the posterior? Don't do this---if you do that, you'll be representing a density which is your original density squared. You can try this for yourself with a simpler model. Draw a whole bunch of normal samples. If you took their histogram, you'd get something like a normal distribution back. Now weight the samples by the normal distribution PDF value ( ... )
Reply
(namely the 1D full conditional for that variable)
yeah, I see what you're saying! And it would be true, except for a minor technicality.
The way I implemented this, if the MH move is rejected, most of the time the proposal will be changing a different variable. So we're not sampling from the 1D full conditional.
Reply
if the posterior samples have lots of duplication (i.e. states are visited multiple times), and I remove the duplication, I'm effectively normalizing, i.e. dividing by the posterior density.
Reply
Reply
(The comment has been removed)
Reply
Think about it like this. Instead of running only a single MH iteration per variable, you could run multiple MH iterations per variable. Some of those iterations would reject, some would accept. >>
hopefully... but anyway, it's not what I'm doing.
<< Nevertheless, the collection of samples you would get, some of which are repeated ... >>
hang on, when the proposed move is rejected, you don't get the current state again, do you? My sources were ambiguous about this.
<< ..., would approximate the conditional distribution of the variable. (Think again in terms of histograms if that helps.) >>
sure.
<< but many MCMC approaches often discard the first few samples to allow the sampler to "burn in", i.e. converge on an area of high probability from a less likely initialization state. (As you probably know.) It might be better for you to run a few iterations of the sampler per variable as you perform your Gibbs sampling; that way you can be ( ... )
Reply
That's correct; you get the current state again.
Reply
Leave a comment