Hi everyone
I have a model that compiles but produces an error when I try to run with multiple definitions of variable s[1]. I’m not so familiar with OpenBUGS so your help would be greatly appreciated.
The problem
==========
I am trying to fit an exact Beta-Poisson dose response model to Campylobacter data, i.e. estimate the parameters aa and bb.
I have six concentrations of bacteria (the Lambdas = mean ingested CFUs) from which people receive a Poisson(Lambda) dose.
The probability that an individual CFU will cause infection follows a Beta distribution with parameters aa,bb. It follows a distribution to reflect the variation in susceptibility between people. [Note: if x follows a Beta(aa,bb) then (1-x) follows a beta(bb,aa) ].
n is the number of people given a dose with mean CFUs Lambda, of whom
s become infected.
The code
=======
model
        {
                for (i in 1 : K)        {
                        for (j in 1 : n) {
                                                dose[i,j] ~ dpois(Lambda)
                                                q[i,j] ~ dbeta(bb,aa)
                                                p[i,j] <- 1 - pow(q[i,j] ,
dose[i,j] )
                                                inf[i,j] ~ dbern(p[i,j])
                                                }
                                        s <- sum( inf[i, 1:n ] )
                                        }
                aa ~ dexp(1)
                aa ~ dexp(1)
        }
Data
        list(
        Lambda = c(800,8000,90000,800000,1000000,100000000),
        n = c(10,10,13,11,19,5),
        s = c(5,6,11,8,15,5),
        K = 6)
Inits
        list(alpha = 1, beta = 1)
        list(alpha = 10, beta = 10)
Any thoughts? Thanks