I'm trying to do variable selection within a zero-truncated poisson glm. Some of the variables are higher order terms and I want to enforce marginality, such that a higher order term can't enter into the model unless its lower order analogs are also included. Obviously these variables will be correlated with one another, so I've scaled them and want to update them en bloc within JAGS. I've done this using the following code (I've included year as a random effect and only showed the code with one co-variate, although I have many):
By updating the coefficients en bloc, it appears that all terms are included equally (for certain variables) such that w[1] = w[2] = w[3] = 1 and the posterior marginal probability is always the same for w[1], w[2], and w[3] (this seems odd). If I don't update the coefficients en bloc this doesn't happen, but mixing is poor. Am I coding something incorrectly, I can't understand why updating coefficients en bloc forces all terms within a block to be included at any iteration. Obviously, this logic doesn't work for exclusion because if a low-order term doesn't make it into the model no higher-order term will either. I also realize the I'm penalizing models with higher order terms from the get go.
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You can fit the zero-truncated Poisson model in JAGS without resorting to the zeros trick
y[i] ~ dpois(mu[i]) T(1, )
Your plan is to force block updating of the beta parameters by defining them as a multivariate normal, even though they are a priori independent. You should check what sampling method is being used (using list.samplers in rjags, or "samplers to <filename>" in the command line interface). I suspect it is a random-walk Metropolis album, which is a lousy method and may not be any better than Gibbs sampling.
I think your problem is that you still have poor mixing, but now the poor mixing is manifesting itself in the indicator variables w[1], w[2], and w[3]. To solve this, you should adopt the approach of Carlin and Chib (Bayesian Model Choice via Markov Chain Monte Carlo Methods, JRSS B, 1995). Instead of having a prior for beta that is concentrated around zero when the corresponding term is out of the model, you should create a pseudo-prior that resembles the posterior distribution when the term is in the model. This allows the Markov chain to jump back and forth more easily between the two states. Calibrating the pseudo-priors requires some test runs but should pay off in terms of mixing.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the advice, I very much appreciate it. Although, I hesitate to use Carlin and Chib's method as they require you to take a two-stage approach. First fitting all the models separately, then using the posteriors to approximate the pseudo-priors for other models, so as to adjust the prior probability on each model when fitting all models together to ensure they're visited frequently. I have a lot of covariates, and this method is impractical. Do you have any other suggestions?
Thanks for you time.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey all,
I'm trying to do variable selection within a zero-truncated poisson glm. Some of the variables are higher order terms and I want to enforce marginality, such that a higher order term can't enter into the model unless its lower order analogs are also included. Obviously these variables will be correlated with one another, so I've scaled them and want to update them en bloc within JAGS. I've done this using the following code (I've included year as a random effect and only showed the code with one co-variate, although I have many):
By updating the coefficients en bloc, it appears that all terms are included equally (for certain variables) such that w[1] = w[2] = w[3] = 1 and the posterior marginal probability is always the same for w[1], w[2], and w[3] (this seems odd). If I don't update the coefficients en bloc this doesn't happen, but mixing is poor. Am I coding something incorrectly, I can't understand why updating coefficients en bloc forces all terms within a block to be included at any iteration. Obviously, this logic doesn't work for exclusion because if a low-order term doesn't make it into the model no higher-order term will either. I also realize the I'm penalizing models with higher order terms from the get go.
Thanks!
Hi John
You can fit the zero-truncated Poisson model in JAGS without resorting to the zeros trick
Your plan is to force block updating of the beta parameters by defining them as a multivariate normal, even though they are a priori independent. You should check what sampling method is being used (using
list.samplers
in rjags, or"samplers to <filename>"
in the command line interface). I suspect it is a random-walk Metropolis album, which is a lousy method and may not be any better than Gibbs sampling.I think your problem is that you still have poor mixing, but now the poor mixing is manifesting itself in the indicator variables
w[1]
,w[2]
, andw[3]
. To solve this, you should adopt the approach of Carlin and Chib (Bayesian Model Choice via Markov Chain Monte Carlo Methods, JRSS B, 1995). Instead of having a prior forbeta
that is concentrated around zero when the corresponding term is out of the model, you should create a pseudo-prior that resembles the posterior distribution when the term is in the model. This allows the Markov chain to jump back and forth more easily between the two states. Calibrating the pseudo-priors requires some test runs but should pay off in terms of mixing.Hey Dr. Plummer,
Thanks for the advice, I very much appreciate it. Although, I hesitate to use Carlin and Chib's method as they require you to take a two-stage approach. First fitting all the models separately, then using the posteriors to approximate the pseudo-priors for other models, so as to adjust the prior probability on each model when fitting all models together to ensure they're visited frequently. I have a lot of covariates, and this method is impractical. Do you have any other suggestions?
Thanks for you time.