winbugs load inits显示“this chain contains uninitial

言覃顺顺 |浏览1458次
2019/07/16 10:14
winbugs load inits显示“this chain contains uninitialized variables”,后点gen inits出现“value of order of binomial x[1] must be greater than zero”
  • 问题补充 : 2019/07/16 10:27

    相应的winbugs程序如下,跪求解答:

    model

    {

       for (i in 1:numGroups)

       {

    # numGroups is k, the number of di?erent probabilities

         x[i] ~dbin(p[i],n[i])

    # In each group, x is the number of responses and n is the number of patients

         logit(p[i]) <-rho[i]

         rho[i]~dnorm(mu,tau)

         pg[i]<-step(p[i]-targetResp)

    # Probability that the response rate for each group is ¿ than targetResp,which is fixed response probability|D*

       }

    #Priors

         mu~dnorm(mean.Mu, perc.Mu)

         tau~dgamma(tau.alpha, tau.beta)

    }

    # Example data

    list(x=c(0,0,1,3,5,0,1,2,0,0), n=c(0,2,1,7,5,0,2,3,1,0), numGroups=10,targetResp=0.30

    mean.Mu=-1.3863, perc.Mu=.10, tau.alpha=2, tau.beta=20)

    # Example of initial values

    list(mu=1, tau=.10)


收藏关注
全部回答(0)
0人关注该问题
 加载中...