model{ # Decision data for(i in 1:nstim){ y[i]~dbin(r[i],t) pred[i]~dbin(r[i],t) } # Similarity computation for(i in 1:nstim){ for(j in 1:nstim){ s[i,j]<-exp(-c*(w*d1[i,j]+(1-w)*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(i in 1:nstim){ temp1[i]<-inprod(s[i,],index1) temp2[i]<-inprod(s[i,],index2) r[i]<-temp1[i]/(temp1[i]+temp2[i]) } # Priors c~dunif(0,5) w~dbeta(1,1) }