model { Tau.noninformative <- 1.0E-2 Tau.gamma <- 1.0E-3 Tau.massA <- 10.0 # Observation for (i in 1:N.quad) { for (j in 1:N.sp) { MassA[i, j] ~ dnorm(massA[i, j], Tau.massA) log(massA[i, j]) <- 2 * log.potential[i, j] - log.sum.potential[i] } } # Process for (i in 1:N.quad) { log.sum.potential[i] <- log(sum(potential[i,])) for (j in 1:N.sp) { potential[i, j] <- exp(log.potential[i, j]) log.potential[i, j] ~ dnorm(log.mu[i, j], tau.log.potential) log.mu[i, j] <- ( (betaB[1] + betaS[1, j]) + (betaB[2] + betaS[2, j]) * Alt[i] + betaB[3] * Tree[j] + betaB[4] * Evergreen[j] ) } } # Parameters and hyper parameters tau.log.potential ~ dgamma(Tau.gamma, Tau.gamma) for (k in 1:N.betaB) { betaB[k] ~ dnorm(0, Tau.noninformative) } for (k in 1:N.betaS) { for (j in 1:N.sp) { betaS[k, j] ~ dnorm(0, tau.betaS[k]) } tau.betaS[k] ~ dgamma(Tau.gamma, Tau.gamma) } }