model { #################################################################### ## Attribution accross reservoirs mu.m <- 0 mu.epsilon <- 0 prec.resvr <- 0.01 prec.else <- 0.01 for(k in 2:stud.n_MODEL){ m.MODEL[k] ~ dnorm(mu.m, prec.else); epsilon.MODEL[k] ~ dnorm(mu.epsilon, prec.else); P.MODEL[k] ~ dnorm(m.MODEL[j],exp(epsilon.MODEL[k])) } P.MODEL[1] <- 0 for(j in 2:stud.n_METHOD){ m.METHOD[j] ~ dnorm(mu.m, prec.else); epsilon.METHOD[j] ~ dnorm(mu.epsilon, prec.else); P.METHOD[j] ~ dnorm(m.METHOD[j],exp(epsilon.METHOD[j])) } P.METHOD[1] <- 0 for(i in 1:stud.n_reservoir){ m.reservoir[i] ~ dnorm(mu.m, prec.resvr); epsilon.reservoir[i] ~ dnorm(mu.epsilon, prec.resvr); P.reservoir[i] ~ dnorm(m.reservoir[i],exp(epsilon.reservoir[i])) } for(ide in 1:stud.n_ID) { for(i in 1:stud.n_reservoir) { for(j in 1:stud.n_METHOD) { for(k in 1:stud.n_MODEL) { P[i,j,k,ide] <- ilogit(P.reservoir[i] + P.MODEL[k] + P.METHOD[j] ) log10.P[i,j,k,ide] <- log(P[i,j,k,ide]) / log(10) } } } } ## setting distribution for unknown/missing number of counts ## an arbitrtay ramping distribution which favours lower values for(l in 1:stud.n_EXPERIMENT){ lmbd.extra[l] ~ dnorm(0, 0.01) n.extra.aux[l] ~ dpois(exp(lmbd.extra[l])) n.extra.counts[l] <- round(n.extra.aux[l]) } for(i in 1:stud.n){ n.eff.counts[i] <- n.total.counts[i] + n.extra.counts[EXPERIMENT[i]] } for(i in 1:stud.n){ ### Here fuzz data according to how old it is sig.pos.cases[i] <- (max(2020-AVG.YEAR[i] , 1)) precision.positive.cases[i] <- 1/(sig.pos.cases[i])^3 observed.cases[i] ~ dnorm(cases[i],precision.positive.cases[i]) ##################### single binomials for atribution ##################### cases[i] ~ dbin( P[reservoir[i], METHOD[i], MODEL[i], STUDY[i] ], n.eff.counts[i]) } #################################################################################### ################ Attribution accross transmission routes ######################## ################################################################################# ########## General transmission routes and expert opinion (trms) trms.expert.prec.log <- 1 prec <- 0.01 for(j in 1:trms.n_exp.Exposure){ m.trms[j] ~ dnorm(mu.m, prec); u.trms[j] <- exp(m.trms[j]) / (1+exp(m.trms[j])) P.trms[j] <- u.trms[j]/sum.u.trms log10.P.trms[j] <- log(P.trms[j]) / log(10) } sum.u.trms <- sum(u.trms) lambd.vague.cases.trms ~ dlnorm(7,0.0001) for(j in 1:trms.n){ trms.n.cases.total[j] ~ dpois(lambd.vague.cases.trms) ## for handling absent cases trms.reduct.eff[j] <- min( trms.CP.observed[j]/trms.CP.experts[j], 1 ) ## reduction all cases to effective number trms.n.cases.eff[j] <- round( trms.reduct.eff[j]*trms.n.cases.total[j] ) trms.n.observed[j] ~ dbin(P.trms[trms.Exposure[j]], trms.n.cases.eff[j]) zero.trms[j] ~ dnorm((log(trms.P.Expert.estimates[j])- log(P.trms[trms.Exposure[j]])), trms.expert.prec.log) } ##################################################### ##################################################### ############## Foodborne-only transmission routes and expert opinion (fb) fb.expert.prec.log <- 1 for(j in 1:fb.n_fb.Foodborne.exposure){ w.fb[j] ~ dnorm(mu.m, prec); u.fb[j] <- exp(m.fb[j]) / (1+exp(m.fb[j])) P.fb[j] <- u.fb[j]/sum.u.fb log10.P.fb[j] <- log(P.fb[j]) / log(10) } sum.u.fb <- sum(u.fb) lambd.vague.cases.fb ~ dlnorm(7,0.0001) for(j in 1:fb.n){ fb.n.cases.total[j] ~ dpois(lambd.vague.cases.fb) fb.reduct.eff[j] <- min( fb.CP.observed[j]/fb.CP.experts[j], 1 ) ## reduction all cases to effective number fb.n.cases.eff[j] <- round( fb.reduct.eff[j]*fb.n.cases.total[j] ) fb.n.observed[j] ~ dbin(P.fb[fb.Foodborne.exposure[j]], fb.n.cases.eff[j]) zero.fb[j] ~ dnorm((log(fb.P.Experts.estimates[j]) - log(P.fb[fb.Foodborne.exposure[j]])), fb.expert.prec.log) } } data { for(j in 1:trms.n){ zero.trms[j] <- 0 } for(j in 1:fb.n){ zero.fb[j] <- 0 } }