model{ # Decision data for(k in 1:nsubj){ for(i in 1:nstim){ y[i,k]~dbin(r[i,k],t) pred[i,k]~dbin(r[i,k],t) } } # Similarity computation for(k in 1:nsubj){ for(i in 1:nstim){ for(j in 1:nstim){ s[i,j,k]<-exp(-c[k]*(w[k]*d1[i,j]+(1-w[k])*d2[i,j])) } } } # Check if exemplar belongs to Category 1 for(j in 1:nstim){ index1[j]<-1*(a[j]==1)+0*(a[j]==2) index2[j]<-1-index1[j] } # Decision probability for(k in 1:nsubj){ for(i in 1:nstim){ temp1[i,k]<-inprod(s[i,,k],index1) temp2[i,k]<-inprod(s[i,,k],index2) r[i,k]<-temp1[i,k]/(temp1[i,k]+temp2[i,k]) } } # Priors for(k in 1:nsubj){ c[k]~dunif(0,5) w[k]~dbeta(1,1) } }