# Model for Environmental covariates for the Seal Pups example. # This code was written by Devin Johnson. # # For more info, see: Johnson, D. S., J. A. Hoeting, and B. S. Fadely # (2007), "Random Effects Graphical Regression Models for # Multidimensional Categorical Data", submitted. (Email Hoeting for a copy). model { for(s in 1:S){ dds[s,1:3] ~ dmnorm(mu[s,1:3],T[1:3,1:3]) substr[s] ~ dcat(P[]) for(j in 1:3){ mu[s,j] <- tau.e[j] + tau.s[j,substr[s]] } } for(j in 1:5){ L[j] <- exp(lambda[j]) P[j] <- L[j]/sum(L[]) } for(k in 2:5){lambda[k] ~ dnorm(0,0.1)} lambda[1] <- 0 for(j in 1:3){ tau.e[j] ~ dnorm(0,0.01) for(k in 2:5){ tau.s[j,k] ~ dnorm(0,0.01) } tau.s[j,1] <- 0 } T[1:3,1:3] ~ dwish(R[1:3,1:3],3) }