I'm building a rather complex hierarchical Bayesian model for a meta-analysis using R and JAGS. Simplifying a bit, the two key levels of the model have $$ y_{ij} = \alpha_j + \epsilon_i$$ $$\alpha_j = \sum_h \gamma_{h(j)} + \epsilon_j$$ where $y_{ij}$ is the $i$th observation of the endpoint (in this case, GM vs. non-GM crop yields) in study $j$, $\alpha_j$ is the effect for study $j$, the $\gamma$s are effects for various study-level variables (the economic development status of the country where the study was done, crop species, study method, etc.) indexed by a family of functions $h$, and the $\epsilon$s are error terms. Note that the $\gamma$s are not coefficients on dummy variables. Instead, there are distinct $\gamma$ variables for different study-level values. For example, there is $\gamma_{developing}$ for developing countries and $\gamma_{developed}$ for developed countries.
I'm primarily interested in estimating the values of the $\gamma$s. This means that dropping study-level variables from the model is not a good option.
There's high correlation among several of the study-level variables, and I think this is producing large autocorrelations in my MCMC chains. This diagnostic plot illustrates the chain trajectories (left) and the resulting autocorrelation (right):
As a consequence of the autocorrelation, I'm getting effective sample sizes of 60-120 from 4 chains of 10,000 samples each.
I have two questions, one clearly objective and the other more subjective.
Other than thinning, adding more chains, and running the sampler for longer, what techniques can I use to manage this autocorrelation problem? By "manage" I mean "produce reasonably good estimates in a reasonable amount of time." In terms of computing power, I'm running these models on a MacBook Pro.
How serious is this degree of autocorrelation? Discussions both here and on John Kruschke's blog suggest that, if we just run the model long enough, "the clumpy autocorrelation has probably all been averaged out" (Kruschke) and so it's not really a big deal.
Here's the JAGS code for the model that produced the plot above, just in case anyone is interested enough to wade through the details:
model {
for (i in 1:n) {
# Study finding = study effect + noise
# tau = precision (1/variance)
# nu = normality parameter (higher = more Gaussian)
y[i] ~ dt(alpha[study[i]], tau[study[i]], nu)
}
nu <- nu_minus_one + 1
nu_minus_one ~ dexp(1/lambda)
lambda <- 30
# Hyperparameters above study effect
for (j in 1:n_study) {
# Study effect = country-type effect + noise
alpha_hat[j] <- gamma_countr[countr[j]] +
gamma_studytype[studytype[j]] +
gamma_jour[jourtype[j]] +
gamma_industry[industrytype[j]]
alpha[j] ~ dnorm(alpha_hat[j], tau_alpha)
# Study-level variance
tau[j] <- 1/sigmasq[j]
sigmasq[j] ~ dunif(sigmasq_hat[j], sigmasq_hat[j] + pow(sigma_bound, 2))
sigmasq_hat[j] <- eta_countr[countr[j]] +
eta_studytype[studytype[j]] +
eta_jour[jourtype[j]] +
eta_industry[industrytype[j]]
sigma_hat[j] <- sqrt(sigmasq_hat[j])
}
tau_alpha <- 1/pow(sigma_alpha, 2)
sigma_alpha ~ dunif(0, sigma_alpha_bound)
# Priors for country-type effects
# Developing = 1, developed = 2
for (k in 1:2) {
gamma_countr[k] ~ dnorm(gamma_prior_exp, tau_countr[k])
tau_countr[k] <- 1/pow(sigma_countr[k], 2)
sigma_countr[k] ~ dunif(0, gamma_sigma_bound)
eta_countr[k] ~ dunif(0, eta_bound)
}
# Priors for study-type effects
# Farmer survey = 1, field trial = 2
for (k in 1:2) {
gamma_studytype[k] ~ dnorm(gamma_prior_exp, tau_studytype[k])
tau_studytype[k] <- 1/pow(sigma_studytype[k], 2)
sigma_studytype[k] ~ dunif(0, gamma_sigma_bound)
eta_studytype[k] ~ dunif(0, eta_bound)
}
# Priors for journal effects
# Note journal published = 1, journal published = 2
for (k in 1:2) {
gamma_jour[k] ~ dnorm(gamma_prior_exp, tau_jourtype[k])
tau_jourtype[k] <- 1/pow(sigma_jourtype[k], 2)
sigma_jourtype[k] ~ dunif(0, gamma_sigma_bound)
eta_jour[k] ~ dunif(0, eta_bound)
}
# Priors for industry funding effects
for (k in 1:2) {
gamma_industry[k] ~ dnorm(gamma_prior_exp, tau_industrytype[k])
tau_industrytype[k] <- 1/pow(sigma_industrytype[k], 2)
sigma_industrytype[k] ~ dunif(0, gamma_sigma_bound)
eta_industry[k] ~ dunif(0, eta_bound)
}
}