model{ for(i in 1:N1){ t[i,1:2]~dmnorm(mu,precI) for(j in 1:N2){ K[i,j]~dnorm(t[i,j],lambdaerror[j]) } } # Priors for(j in 1:N2){ mu[j]~dnorm(0,0.001) lambdaerror[j]~dgamma(0.001,0.001) lambda[j]~dgamma(0.001,0.001) } precI<-inverse(prec) prec[1,1]<-1/lambda[1] prec[2,2]<-1/lambda[2] prec[1,2]<-rho/(pow(lambda[1],0.5)*pow(lambda[2],0.5)) prec[2,1]<-rho/(pow(lambda[1],0.5)*pow(lambda[2],0.5)) rho~dunif(-1,1) }