Handling unequal survey occasions per site in NIMBLE

25 views
Skip to first unread message

Fiona Victoria

unread,
Mar 12, 2026, 11:35:09 PMMar 12
to nimble-users

I am working on a dynamic occupancy model in NIMBLE where each site corresponds to a meadow observed in a particular year. Within each site-year there are repeated surveys during the season (“watches”), and detection is measured across multiple plots during each survey.

The challenge is that the number of surveys differs among years. Some years have around 5–7 watches, while others only have 3. I would like to fit a single model across all years and sites without discarding data from years that have more surveys.

I wanted to ask whether there is a recommended way in NIMBLE to handle different numbers of survey occasions per site in dynamic occupancy models.


Thanks,
Fiona

heather...@gmail.com

unread,
Mar 13, 2026, 6:41:12 AMMar 13
to Fiona Victoria, nimble-users
Hi Fiona,

There are several ways to go about this. 

If you have watch-level covariates, the easiest is to create an object called effort (or whatever you want to name it ) that is a binary matrix representing if the site was surveyed. Something like:

for(i in 1:nsites){
for(t in 1:n years){
Occ[i,t] ~ dbern(Some prob of occupancy)
for(q in 1:max.watches){
Logit(p[i,t,q]) <- equation for detection 
Y[i,t,q] ~ dbern(p[i,t,q]*Occ[i,t]*effort[i,t,q])
}}}

Alternatively, you can make your loop dynamic:

for(i in 1:nsites){
for(t in 1:n years){
Occ[i,t] ~ dbern(Some prob of occupancy)
for(q in 1:Surveys[i,t]){
Logit(p[i,t,q]) <- equation for detection 
Y[i,t,q] ~ dbern(p[i,t,q]*Occ[i,t])
}}}

Note that either way you end up having to create a Y object that is the same dimensions, but this just controls if a detection from an un-surveyed site is a 0 or an NA. The output will be the same so it’s just a personal choice. 

-Heather Gaya 

Sent from my iPhone; please excuse any typos

On Mar 12, 2026, at 11:35 PM, Fiona Victoria <fiona.v...@gmail.com> wrote:


--
You received this message because you are subscribed to the Google Groups "nimble-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nimble-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/nimble-users/c51923c6-a98f-4649-8204-86714ba8d779n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages