model { # likelihood for (i in 1:N.sample) { inv.sq.sigma[i] <- exp(-2 * (log.sd + log.sdMt[Mt[i]])) n.total[i] <- ( Flarea[i] * exp( log.sp + log.spMt[Mt[i]] # seed production + log.spFl[Fl[i]] # the quality of fallen log ) * Mdbh[i] * Mdbh[i] * exp( # dispersal -0.5 * Distance[i] * Distance[i] * inv.sq.sigma[i] ) * Dkernel.const * inv.sq.sigma[i] ) logit(sv[i]) <- logit.sv + logit.svFl[Fl[i]] n.seedlings[i] <- (1 - sv[i] * sv[i]) * n.total[i] n.saplings[i] <- sv[i] * sv[i] * n.total[i] N.seedlings[i] ~ dpois(n.seedlings[i]) N.saplings[i] ~ dpois(n.saplings[i]) } # priors log.sp ~ dnorm(0.0, Tau.noninformative) log.sd ~ dnorm(0.0, Tau.noninformative) logit.sv ~ dnorm(0.0, Tau.noninformative) for (j in 1:N.mt) { log.spMt[j] ~ dnorm(0.0, tau.log.spMt) log.sdMt[j] ~ dnorm(0.0, tau.log.sdMt) } for (k in 1:N.fl) { log.spFl[k] ~ dnorm(0.0, tau.log.spFl) logit.svFl[k] ~ dnorm(0.0, tau.logit.svFl) } # Hyper priors tau.log.spMt ~ dgamma(Hyper.gamma, Hyper.gamma) tau.log.sdMt ~ dgamma(Hyper.gamma, Hyper.gamma) tau.log.spFl ~ dgamma(Hyper.gamma, Hyper.gamma) tau.logit.svFl ~ dgamma(Hyper.gamma, Hyper.gamma) }