model { Tau.noninformative <- 1.0E-3 Hyper.gamma <- 1.0E-2 Tau.measurement <- 100 for (i in 1:N.sample) { # measurements X.measurement[i] ~ dnorm(x[i], Tau.measurement) Y.measurement[i] ~ dnorm(y[i], Tau.measurement) # weight allocation between root and shoot x[i] <- exp(log.totalw[i]) * (1.0 - p[i]) y[i] <- exp(log.totalw[i]) * (p[i]) logit(p[i]) <- logit.p[i] logit.p[i] ~ dnorm(mean.logit.p[i], tau.tree) mean.logit.p[i] <- ( bb[1] + bs[1, Spc[i]] + (bb[2] + bs[2, Spc[i]]) * (log.totalw[i] - Mean.log.totalw) ) # total weight log.totalw[i] ~ dnorm(Mean.log.totalw, Tau.noninformative) } # parameters tau.tree ~ dgamma(Hyper.gamma, Hyper.gamma) # individual effects for (k in 1:N.b) { bb[k] ~ dnorm(0.0, Tau.noninformative) # common part for (s in 1:N.spc) { # differences among species bs[k, s] ~ dnorm(0.0, tau.bs[k]) } tau.bs[k] ~ dgamma(Hyper.gamma, Hyper.gamma) # for species } }