全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 winbugs及其他软件专版
1138 0
2014-06-17
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





二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

分享

扫码加好友,拉您进群