3

I am still green in handling Bayesian methods. In a bit to run Bayesian Analysis with a random effect on a real data , I encountered the following error "slicker stuck at value with infinite density", I tried altering the starting values of the precision parameter (based on suggestion I found on stackoverflow ), as well as other starting values for my parameters, but that didn't solve the problem. Here is part of my code

    cat("model
    {
    for( i in 1 : N) {
    D[i] ~ dpois(r[i])
    log(r[i]) <- mu[i] + log(pt[i])
    mu[i] ~ dnorm(theta,precision)
    }
    theta ~ dnorm(0.0,1.0E-6)
    ExpTheta <- exp(theta)
    tau1 ~ dgamma(0.001,0.001)
    precision <- 1/(tau1*tau1)
    }", file="myfile.txt")

I observed that the following solved the issues:

  1. Truncating the normal prior in the form ( theta ~ dnorm(0,1.0E-5) T(0,0.99)

The problem with the above solution in my case is that my estimates are more than usual. Secondly I don't really understand how the truncated normal fits into my solution. Can someone give me an insight into truncated normal and how it affects the interpretation of the results generated using it?

  1. The second option was to use very low number of iteration. I observed with low number of iteration the model stops throwing up the error.

The problem with this was that convergence was not suspect.

  1. The third option that worked was that I had to change by gamma prior from gamma(0.001,0.001) to gamma(1,1). I am not sure how going from gamma(0.001,0.001) to gamma(1,1) will affect my interpretation but the result obtained seems reasonable.

I would appreciate some comments on the merit/demerits of the above mentioned fixes with regards to the modeling process and how it could affect inference.

Additional information,D is count observed, pt is the person-time (offset).

mymymine
  • 49
  • 7
  • I'd love to read the answer to this question! Maybe you can include your data and any other code you used to make this totally reproducible? – Michael Roswell Jul 05 '19 at 18:31

0 Answers0