biodiverse / ubms

Fit models to data from unmarked animals using Stan. Uses a similar interface to the R package 'unmarked', while providing the advantages of Bayesian inference and allowing estimation of random effects.
https://hmecology.github.io/ubms/
GNU General Public License v3.0
35 stars 8 forks source link

LOO compatibility #67

Closed NathanGT15 closed 1 year ago

NathanGT15 commented 1 year ago

Hello,

I am trying to use the ubms package to fit an occupancy model with random effects. for model diagnosis, the LOO function does not seem to work anymore. I keep getting this error:

' Error in UseMethod("loo") : no applicable method for 'loo' applied to an object of class "c('ubmsFitOccu', 'ubmsFit')" '

This even happens with the example code on the ubms github page. Has this issue been encountered before?

kenkellner commented 1 year ago

The example code works for me in a fresh R session. Most likely this is because you loaded the loo package after loading ubms and overwrote the method. You should be able to get it to work by either not loading loo in your session or loading it before loading ubms. There's probably some better way to handle it but for now that should work.

NathanGT15 commented 1 year ago

okay both of those methods worked for me, thanks!