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