kenkellner / jagsUI

R package to Run JAGS (Just Another Gibbs Sampler) analyses from within R
https://kenkellner.github.io/jagsUI/
34 stars 8 forks source link

Error in saving some of the monitored parameters #10

Closed eogmartins closed 8 years ago

eogmartins commented 8 years ago

Hi there,

I keep getting the following error and can't figure how to get around this. It happens after the message "Calculating statistics..."

Error in fill[matrix(ind, 1)] <- input[i] : subscript out of bounds

The error occurs when I ask for some matrices to be monitored (the matrices include some observed values and some NAs to be estimated). I don't get the error if I remove the matrices from the vector of parameters to monitored. I ran the same model using R2jags and didn't get the error so I was wondering if this is an issue with jagsUI...

Thanks,

Eduardo

kenkellner commented 8 years ago

Hi Eduardo,

I think this is related to 84b09c7. Would you be willing to send me a minimal example (code + data) that would allow me to reproduce the error? In the meantime, if necessary, I suggest using jags.basic() which will still generate the posterior but skip the stats calculation that is causing you issues. Another workaround is to add the parameter in question to the codaOnly argument.

Ken

eogmartins commented 8 years ago

Hi Ken,

Thanks very much for your response. Yes, I'll send an example code + data to your email.

Cheers,

Eduardo

Ken Kellner wrote:

Hi Eduardo,

I think this is related to 84b09c7 https://github.com/kenkellner/jagsUI/commit/84b09c737398ddbd6f38fb9e5a0aae833a69ae79.

Would you be willing to send me a minimal example (code + data) that would allow me to reproduce the error? In the meantime, if necessary, I suggest using |jags.basic()| which will still generate the posterior but skip the stats calculation that is causing you issues.

Ken

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kenkellner/jagsUI/issues/10#issuecomment-239972601, or mute the thread https://github.com/notifications/unsubscribe-auth/ALt8EPQEC4dYlTa2Qy51LrVxW1IcBnI8ks5qgQl9gaJpZM4Jk40f.

kenkellner commented 8 years ago

This bug appears when trying to determine the dimensions of a parameter (2D or higher) with elements that JAGS does not estimate based on the indexing in the model file. Commit 82194ab appears to fix the issue in the example you provided based on my testing. Can you test the new version of the package and confirm that you are getting the results you expect?

eogmartins commented 8 years ago

Hi Ken,

Thanks very much for fixing this. It's working nicely now and I'm getting the results I expect.

Cheers,

Eduardo

Ken Kellner mailto:notifications@github.com August 16, 2016 at 10:45

This bug appears when trying to determine the dimensions of a parameter (2D or higher) with elements that JAGS does not estimate based on the indexing in the model file. Commit 82194ab https://github.com/kenkellner/jagsUI/commit/82194ab5a1e9a9eaa9540a09f4313c2bb58b7372 appears to fix the issue in the example you provided based on my testing. Can you test the new version https://github.com/kenkellner/jagsUI/files/420943/jagsUI_1.4.3.tar.gz of the package and confirm that you are getting the results you expect?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kenkellner/jagsUI/issues/10#issuecomment-240180841, or mute the thread https://github.com/notifications/unsubscribe-auth/ALt8EEQ2qv45yGE1qFOblzPi6bqY8pV8ks5qgfdUgaJpZM4Jk40f.

kenkellner commented 8 years ago

Glad it's working!