'RJ AGS: hierarchical model expected utility: unable to estimate subject level parameters properly
I am trying to fit simulated data to a hierarchical expected utility model, where the priors of the individual simulated subjects are informed by group level priors. The model is able to recover the parameters for the first simulated subject accurately (simulated alpha: 1.43, recovered alpha: 1.44), but then fails to do so for subjects 2:N. Does anyone have any ideas why this could be the case? I'm happy to provide more information if needed. Thank you!! My model and the correlation plots of the posterior chains below.
model {
#Priors group level
alpha.mu ~ dnorm(0, 1)#T(0.2, 3)
beta.mu ~ dnorm(0, 1)
alpha.sig ~ dunif(0.0001, 10) #prior error alpha
beta.sig ~ dunif(0.0001, 10) #prior error sigma
for (s in 1:Nsubs) { #subject specific priors
alpha.s[s] ~ dnorm(alpha.mu,1/(alpha.sig))
beta.s[s] ~ dnorm(beta.mu,1/(beta.sig))
}
#model
for (j in 1:Nsubs) {
for (i in 1:N) {
Vfa[i, j] <- p1[i] * (x1[i]^alpha.s[j]) #gamble A
Vfb[i, j] <- p2[i] * (x2[i]^alpha.s[j]) # gamble B
pr[i, j] <- ilogit(beta.s[j]*(Vfb[i, j] - Vfa[i, j]))
}
}
for (i in 1:N) {
choice[i] ~ dbern(pr[i, subIdx[i]] )
}
}
The posterior chain correlation plots for the first two simulated subjects are below. The parameters for subject 1 are recovered nicely, but the parameters of subject two do not
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|