Of course, if pID<1, the data contains less information, and we expect some drop off in precision, but the effect is greater than I expected. For models where the number of marked animals is known, here is what I observed with simmed data:
If I change pID from 1 to 0.8, my model does not converge.
If pID=0.8 and I double resight sessions from 5 to 10, my model does not converge.
If pID=0.8 and I double g0 from 0.2 to 0.4, my model does not converge.
If pID=0.8 and I include the marking session (and drop a resight session), the above models do converge.
Again, I understand the marking session provides more information, but the effect is much stronger than I would expect. Also, in many mark-resight surveys, capture is relatively ad-hoc and there is not a clean capture session to model, so I would like this to work without a capture session.
I provide code below. My questions are, why does pID<1 cause so much trouble? Did I make a mistake? Why does the marking session dramatically improve estimates? Can I do something, either in secr or in the design, to get a secr mark-resight model to converge without a capture session?
- Code: Select all
# I wrote a function to aid repetition
pctID.foo <- function(seed=1, sight.sessions=5, g0=0.2, pctID=1) {
# some parameters
set.seed(seed)
sig <- 8
D <- 46.3
g0.capture <- g0
g0.resight <- g0
# sim grid and animals
grid <- make.grid(nx = 10, ny = 10, spacex = 20, spacey = 20, spacing = NULL,
detector = c("multi", rep("count",sight.sessions)),
originxy = c(0,0), hollow = F, ID = "alphay", markocc = NULL)
pop2 <- sim.popn(grid, D = D, buffer = 0) # expect 150 animals
# sim capture histories
markocc(grid) <- c(1, rep(0, sight.sessions))
g0mr <- c(g0.capture, rep(g0.resight, sight.sessions))
simMS <- sim.resight(grid, detectpar=list(g0 = g0mr, sigma = sig),
popn = pop2, pID = pctID)
# drop either the last (resight) session, or first (capture) session
dropLast <- subset(simMS, occasions=1:sight.sessions) # remove final
dropFirst <- subset(simMS, occasions=2:(sight.sessions+1),
dropnullCH=F) # remove marking session
# (optimal) starting values
ostart <- c(log(D), qlogis(g0.resight), log(sig), qlogis(pctID-0.0000000001))
mask <- make.mask(traps(simMS), nx = 32, buffer = 0) # habitat mask
# fit model
fit.dropLast <- secr.fit(dropLast, model = list(g0 ~ 1),
mask = mask, start=ostart)
fit.dropFirst <- secr.fit(dropFirst, model = list(g0 ~ 1),
mask = mask, start=ostart)
return(data.frame(abund = nrow(pop2),
est.with.mark=tryCatch(region.N(fit.dropLast)[1,1],
error=function(e) NA),
est.without.mark=tryCatch(region.N(fit.dropFirst)[1,1],
error=function(e) NA)
))
} # end function
works <- pctID.foo(seed=1, sight.sessions=5, g0=0.2, pctID=1)
low.pctID <- pctID.foo(seed=1, sight.sessions=5, g0=0.2, pctID=0.8)
high.sessions <- pctID.foo(seed=1, sight.sessions=10, g0=0.2, pctID=0.8)
high.g0 <- pctID.foo(seed=1, sight.sessions=5, g0=0.4, pctID=0.8)
Output of code:
Model || abundance || estimate with marking || estimate w/o marking
works || 142 || 132 || 148
low.pctID || 142 || 131 || NA
high.sessions || 142 || 139 || NA
high.g0 || 142 || 158 || NA
I tried this for several seeds and got similar results. I think I have examples where it does converge, but with low precision and accuracy. Thanks for any ideas!