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

multi-season occupancy? #45

Closed cperk closed 3 years ago

cperk commented 3 years ago

Hi!

Your package looks awesome! I'm excited to try it but couldn't find any code examples on how to do multi-season occupancy (non-stacked). Is this possible with ubms and if so do you have a code example I could try? If not, do you have plans to add this feature soon?

Thank you!

-Carrie

kenkellner commented 3 years ago

Hi,

The stan_colext function can be used for multi-season occupancy modeling. There's a short example if you look at ?stan_colext. If you want more info, such as how to construct the input unmarkedFrame, look at ?unmarkedMultFrame as well as the dynamic occupancy help files and vignettes for colext in the unmarked package, since stan_colext is mean to be similar.

Ken

cperk commented 3 years ago

Ok thanks! I’ll try it. I noticed another issue you’re working on is making it possible to specify our own priors. Is that ready to go, and if so is there example code for it?

On Monday, July 26, 2021, Ken Kellner @.***> wrote:

Hi,

The stan_colext function can be used for multi-season occupancy modeling. There's a short example if you look at ?stan_colext. If you want more info, such as how to construct the input unmarkedFrame, look at ?unmarkedMultFrame as well as the dynamic occupancy help files and vignettes for colext in the unmarked package, since stan_colext is mean to be similar.

Ken

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kenkellner/ubms/issues/45#issuecomment-886729681, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFCT4K6EF7MP3XQGHMPKTPTTZVTEJANCNFSM5A57HCEA .

kenkellner commented 3 years ago

It's not ready yet. Keep an eye on that issue, when it's closed it will be available (in the dev version at least). My current plans for custom priors are pretty simple - if you anticipate needing complicated priors, you're probably better off fitting a custom model in JAGS or Stan.

cperk commented 3 years ago

Ok i understand. It appears the stocc package allows full customization of priors, is that correct?

cperk commented 3 years ago

Also, is it possible to adapt any of these (ubms, stocc) for a dynamic single-visit occupancy model? I have many years of data but only 1 visit per year.

kenkellner commented 3 years ago

stocc does allow some prior customization, but not to the degree that JAGS would allow. Also, it fits single-season spatial occupancy models only, so I'm not sure it fits your requirements.

Unfortunately ubms (and stocc, as far as I know) do not support single-visit models. I'm not aware of an R package that does. It looks like Peach et al. 2017 includes JAGS code for the single-visit dynamic model in the supplement so that might be a good starting point.