Hi all,
I am currently running into a few problems with an OPSCR model I am developing. I have only worked with non-spatial JS/CJS models before, so entirely possible that the error is pretty simple to fix. The short version is that instead of working with a grid of traps, we survey in (more or less) a straight line moving up a mountain stream. As a result, our data only has one axis – the distance (in meters) from the base of the stream. When I run the model, a large portion of the nodes give me the error “: logProb of data node y[-, -, -]: logProb is -Inf.”.
I suspect it is due to the distance between the individuals and the traps reaching zero, but so far have been unable to confirm. I have tried running the model with no X-coordinate as well as a dummy X-coordinate (i.e., with a sequence from 0.99999 to 1.00001), but the errors stay the same. Model code screenshot below (we have 12 years of data, but I trimmed this to just the first 3 to shrink the image a bit). Any advice is appreciated!
Thanks in advance,
Eric
--
You received this message because you are subscribed to the Google Groups "nimble-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nimble-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/nimble-users/e62e4f4d-82b5-4007-a822-639fdb9f7632n%40googlegroups.com.
Hi Perry,
Thanks so much for the quick response! It seems like the error appears before MCMC sampling. I used nimblemodel and the corresponding model$calculate gave me a value of -Inf. There is one initialization error from a column purposely left blank but setting that column to an arbitrary value eliminates the warning but does not fix the errors. From what I can tell, the logProb error occurs in every node where I captured an individual (so obviously not ideal…). I ran it with a smaller simulated dataset (also a big thank you to Olivier Giminez who wrote the simulation functions used and gave a nice example of this kind of model online) and was able to get a full calculation/parameter estimation when the grid was arranged in a small three-dimensional space.
I think that the numerical overflow is the problem here, and may have found a possible explanation, albeit one that I am not quite sure how to fix. If I constrain the simulated y coordinate such that 1 < y < 10, the model works just fine. But if I change nothing except that the simulated y coordinate is 1 < y < 20, the error appears again. I have tried using same exact grid for both simulations as well as expanding the second grid to better accommodate the larger range, but still nothing. I also tried expanding the home range parameter thinking that it might be possible that the longer grid made it so that the probability of an individual being caught in a far away trap was reaching the 2e-16 limit and causing some kind of problem, but no luck there either. Reproducible code is attached here. Apologies if it is a bit on the longer side, but it is essentially just the same model pasted 3 different times – the first two work fine, and the third is where the problems arise. The whole thing runs in ~30 minutes on my end. Thanks again!
Best,
Eric
To view this discussion visit https://groups.google.com/d/msgid/nimble-users/09074d00-fdbc-47c6-ae15-5a3ea5c28962n%40googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/nimble-users/c665405f-8160-400e-be1e-0b6f2e045429n%40googlegroups.com.