# MCMC converging to a single value?

I'm trying to fit a hierarchical model using jags, and the rjags package. My outcome variable is y, which is a sequence of bernoulli trials. I have 38 human subjects which are performing under two categories: P and M. Based on my analysis, every speaker has a probability of success in category P of $\theta_p$ and a probability of success in category M of $\theta_p\times\theta_m$. I'm also assuming that there is some community level hyperparameter for P and M: $\mu_p$ and $\mu_m$.

So, for every speaker: $\theta_p \sim beta(\mu_p\times\kappa_p, (1-\mu_p)\times\kappa_p)$ and $\theta_m \sim beta(\mu_m\times\kappa_m, (1-\mu_m)\times\kappa_m)$ where $\kappa_p$ and $\kappa_m$ control how peaked the distribution is around $\mu_p$ and $\mu_m$.

Also $\mu_p \sim beta(A_p, B_p)$, $\mu_m \sim beta(A_m, B_m)$.

Here's my jags model:

model{
## y = N bernoulli trials
## Each speaker has a theta value for each category
for(i in 1:length(y)){
y[i] ~ dbern( theta[ speaker[i],category[i]])
}

## Category P has theta Ptheta
## Category M has theta Ptheta * Mtheta
## No observed data for pure Mtheta
##
## Kp and Km represent how similar speakers are to each other
## for Ptheta and Mtheta
for(j in 1:max(speaker)){
theta[j,1] ~ dbeta(Pmu*Kp, (1-Pmu)*Kp)
catM[j] ~ dbeta(Mmu*Km, (1-Mmu)*Km)
theta[j,2] <- theta[j,1] * catM[j]
}

## Priors for Pmu and Mmu
Pmu ~ dbeta(Ap,Bp)
Mmu ~ dbeta(Am,Bm)

## Priors for Kp and Km
Kp ~ dgamma(1,1/50)
Km ~ dgamma(1,1/50)

## Hyperpriors for Pmu and Mmu
Ap ~ dgamma(1,1/50)
Bp ~ dgamma(1,1/50)
Am ~ dgamma(1,1/50)
Bm ~ dgamma(1,1/50)
}


The issue I have is that when I run this model with 5000 iterations for adapting, then take 1000 samples, Mmu and Km have converged to single values. I've been running it with 4 chains, and each chain doesn't have the same value, but within each chain there is just a single value.

I'm pretty new to fitting hierarchical models using MCMC methods, so I'm wondering how bad this is. Should I take this as a sign that this model is hopeless to fit, that something is wrong with my priors, or is this par for the course?

Edit: In case it matters, the value for $\mu_m$ it converged to (averaged across chains) was 0.91 and $\kappa_m$ was 1.78

• If I'm understanding you correctly, these parameters "converge" on one fixed value in each chain (after some iterations it doesn't change at all), but that value is different for every chain you run? That sounds bad, like maybe a really crappy Metropolis Hastings step. It could be your model, it could be JAGS, it could be a combination of both. Presumably this model doesn't take too long to fit, so I'd try running (much) longer chains first, especially for the adapting period. – JMS Jun 13 '11 at 18:11
• So, I updated the model with 5000 more iterations, and the parameters in question didn't budge. I didn't realize they could fall into local minima like this. – JoFrhwld Jun 13 '11 at 19:36
• quick sugesstions:1. Try to use dbin, with n=1. And use bounds to limit the value of p. Something like this: p.bound[i] <- max(0, min(1, p[i])) – Manoel Galdino Jun 13 '11 at 20:25
• A couple of clarifying questions: 1. you have 38 subjects under category P and 38 subjects under category M, such as length(y) = 76? 2. Could you give more background information about the rationale for the hyperparamters and the experiment? It's a bit confusing to me. – Manoel Galdino Jun 13 '11 at 20:35
• I'd probably just fix all the hyperparameters, as in theta[j,1] ~ dbeta(1.1, 1.1) or something, and see what results you get before trying to move on to a hyperprior. Also, theta[j,2]'s prior is the product of two betas, which is not, in general, a beta itself, and of course theta[j,2] < theta[j,1] as a result. It looks like you intended this; just out of curiosity, why? – jbowman Dec 4 '11 at 3:07