Skip to content

Comments

Updates for JAGS 5.0.0#174

Open
martynplummer wants to merge 2 commits intolindeloev:mainfrom
rjags-rdepends:main
Open

Updates for JAGS 5.0.0#174
martynplummer wants to merge 2 commits intolindeloev:mainfrom
rjags-rdepends:main

Conversation

@martynplummer
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant