0

Winbugs trap error

    • model
      {
      for (i in 1:5323) {
      Y[i] ~ dpois(mu[i])  # NB model as a Poisson-gamma mixture
      mu[i] ~ dgamma(b[i], a[i])  # NB model as a poisson-gamma mixture
      a[i] <- b[i] / Emu[i]
      b[i] <- B * X[i]
      Emu[i] <- beta0 * pow(X[i], beta1)  # model equation
      }
      
      # Priors
      beta0 ~ dunif(0,10)  # parameter
      beta1 ~ dunif(0,10)   # parameter
      B ~ dunif(0,10)  # over-dispersion parameter
      }
      
      X[]    Y[]
      1.5    0
      2.9    0
      1.49   0
      0.39   0
      3.89   0
      2.03   0
      0.91   0
      0.89   0
      0.97   0
      2.16   0
      0.04   0
      1.12   1s
      2.26   0
      3.6    1
      1.94   0
      0.41   1
      2  0
      0.9    0
      0.9    0
      0.9    0
      0.1    0
      0.88   1
      0.91   0
      6.84   2
      3.14   3
      End ```
      
      
      
  • This is just a sample of the data, the model question is coming from Ezra Hauer 8.3.2, the art of regression of road safety, the model is providing an **error undefined real result. **

  • The aim of model is to fully Bayesian and a one step model and not use empirical bayes.

  • The results should be similar to MLE where beta0 is 1.65, beta1 0.871, overdispersion is 0.531

  • X is the only variable and y is actual collision, So X cannot be zero or negative, while y cannot be lower than zero, if the model in solved as Poisson gamma mixture using maximum likelihood then it can be created

  • How can I make this model work

  • Solving an error in winbugs?

1 Answers1

0

the data is in excel, the model worked fine when I selected the biggest 1000 observations only.