saudiwin / ordbetareg_pack

Repository for R package ordbetareg, used to fit continuous data with lower and upper bounds.
Other
17 stars 3 forks source link

pp_check() error with ordbetareg brmsfit objects #3

Closed jamessteeleii closed 2 years ago

jamessteeleii commented 2 years ago

I've noticed the few times I have fit ordbetareg models that, while I can use plot() to produce trace plots to inspect the model, pp_check() doesn't appear to work. I get the following error each time I try to use the function on an ordbetareg model:

> pp_check(model) 
Using 10 posterior samples for ppc type 'dens_overlay' by default.
Error in checkForRemoteErrors(val) : 
  23 nodes produced errors; first error: invalid arguments
jamessteeleii commented 2 years ago

I've just realised the error above was due to me having fit the models in parallel. When I set pp_check(model, cores = 1) the above error doesn't occur, but I do get the following:

Error in rbeta(n = N, plogis(mu) * phi, (1 - plogis(mu)) * phi) : 
  invalid arguments

The same errors occur when I try to reproduce the model from the vignette and then perform pp_check() too. I can't tell if it's something wrong locally for me or not though. Of course, this applies to other similar functions for posterior predictive draws too.

jamessteeleii commented 2 years ago

Oh, the exception seems to be insight::get_predicted. That seems to work.

saudiwin commented 2 years ago

I can't reproduce this error. The vignette runs fine and uses pp_check. Maybe you should use that dataset and see if it works on your system as well.

jamessteeleii commented 2 years ago

Thanks Robert - yep I tried to just run the vignette example using the pew dataset, but same errors. I got a friend to try and it worked fine for him so must be something local to my system causing issues. I tried to uninstall the package and reinstall but same issue. It's not the end of the world as insight::get_predicted works for some reason to get the posterior predicted draws. I may try to completely uninstall everything and reinstall at some point and see if that resolves it.

saudiwin commented 2 years ago

Yes the vignette works fine with the current version of idealstan, so without some way to replicate this I'm going to need to close the issue. However, if you can help me reproduce then I can try and fix whatever is broken.