Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes to initial values in JAGS 5.0.0 have revealed issues with some models in mcp. These issues were always present but hidden by the deterministic starting values in previous versions of JAGS.
For autoregressive Poisson and binomial models, the use of the link function to calculate residuals on the scale of the linear predictor leads to numerical overflow when the outcome variable is on the boundary (i.e. y=0 for binomial and Poisson, and y=m for binomial, where m is the size parameter). I've added a small amount of shrinkage away from the boundary. This prevents numerical overflow but I suspect that there will still be statistical problems. I don't have enough experience with autoregressive GLMs to make a better suggestion, but I think there is a case for using Pearson residuals and not trying to work on the scale of the linear predictor. I leave that in your hands.
The reason this was never a problem before is twofold. Firstly the model was always initialized with a an autoregression coefficient of zero. Secondly, JAGS does not use IEEE754 arithmetic so that 0 * Inf = 0. This behaviour (copied from BUGS) means the numerical overflow of the residuals was ignored.
I also found that I had to initialize some random effects standard deviation to a small positive value.
Finally, to get the package to pass R CMD check, I made some changes for updates in the ggplot2 package (is.plot -> is_plot).