Recommended way to create a new mask in regionN

48 views
Skip to first unread message

Nianfan Ding

unread,
Apr 7, 2025, 10:27:01 AMApr 7
to secr

Dear secr users,

I’ve been thinking about this challenge for a long time. And I finally decided to ask.

Wildlife managers often come to me with camera trap data and ask me to help them estimate density. Thanks to secr, we are free from the mud of traditional "effective trapping area" and can estimate density directly.

I've put in a lot of effort to convince my partners that population size is often "ill-defined" and it's better to just look at density. But people also want a simple answer to "how many animals do we have? (which makes sense). To get this through regionN, I found myself back in the same old mess: it used to be what area to divide N by, and now what area to multiply D by.

From the papers available to me, I have seen people create a new mask by:

  1. Simply use the mask used for model fitting.
  2. Buffer around camera traps using the daily moving distance, or the maximum migration distance from general knowledge of a species.
  3. Buffer using the Mean Maximum Moving Distance (MMDM) or other approaches in conventional capture-recapture.
  4. Buffer using sigma from a fitted secr.
  5. Fit occupancy or presence-only models using another independent dataset, then using the “suitable habitat (occurrence probability > x)” as the new mask.

The first three don't seem convincing to me. I'm not quite sure about the fourth. And we rarely have independent data like that to fit occupancy models in the fifth.

I wish that our animals lived on an isolated island, but they don’t. I understand that there may not be a best method, but if we have to estimate population size in a continuous habitat, what would be the least wrong way to create a new mask?

Thank you all in advance.


Murray Efford

unread,
Apr 7, 2025, 4:54:36 PMApr 7
to secr
I sympathise and believe there is a real underlying problem that deserves more thought, but...

i. You already have the arguments to rebut 1-3, and I think 4 is equally weak: these all measure a completely arbitrary number.
ii. Supposing there is a naturally delimited population, but we just don't know its extent, what can we learn from a conventional SECR model that estimates density? I don't like the idea of outsourcing the delimitation problem to occupancy - just another can of worms (definition of occupancy, temporal duration etc. see Efford & Dawson 2012).
iii. I am pretty sure there are feasible SECR designs that would scatter detectors within, across and beyond a hypothesised limit and then fit a density model that crashed to zero as a function of a suitable covariate (e.g. distance from centre). The outer detectors might be solitary, just there to determine absence.

Alternatively, just fit a non-spatial model. But then you lose the benefits of SECR (controlling individual heterogeneity etc.). As I said, this is a topic that needs attention.
Murray

Nianfan Ding

unread,
Apr 8, 2025, 7:52:31 AMApr 8
to secr

Thank you so much Murray for your quick response. Your insights and suggestions are a huge help to us.

Nianfan Ding

unread,
Apr 8, 2025, 10:51:48 AMApr 8
to secr
Your answer leads me to further think about that...

1. For such a naturally delimited population whose real density drops to zero at the edge, when we fit a common homogeneous SECR, how should the density estimate be interpreted? Is it the average density within the delimitation, or the density very close to the detectors?

2. If we stick with SECR for its advantages over non-spatial models, would it be safer to select a rather small number (e.g., a few km, or even the MCP of detectors) to buffer, and explicitly states that the abundance estimate is for that small surveyed area, not the entire population? Since all those numbers are arbitrary, would a large number be even worse for the risk of over-extrapolating density?

Thanks again for your kind suggestions.
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Murray Efford

unread,
Apr 15, 2025, 1:32:46 AMApr 15
to secr
[I took the liberty of deleting some misleading messages I posted a week ago. The simulations did not vary the population extent independently of the mask extent as intended. This is a corrected post. My apologies for any confusion]
Responding to Nianfan Ding 9 April:
1. That depends on the extent of the mask, but probably somewhere between the two choices.
2. It's arbitrary. Using a very small mask area ensures positive bias in density. 

I tried some simulations using N-hat as the criterion. Here the grey area is the mask. Each 'population' comprised 256 activity centres (circles). Numbers are estimated N-hat for the given combination.  Code below.

The results for N-hat  depend on the relative extent of the mask and the population, as you would expect. Results are good only on the diagonal where the two match. I also considered populations whose extent was less than that of the detector array - results to be reported separately.

Murray
extent sims.png


runone <- function (buffer, mask) {
    pop <- sim.popn(core = grid, buffer = buffer, Ndist = 'fixed',  Nbuffer = 256)
    ch <- sim.capthist(grid, popn = pop, detectfn = 'HHN', detectpar =
                           list(lambda0 = 0.2, sigma = 20), noccasions = 5)
    customextractfn(secr.fit(ch, mask = mask, detectfn = 'HHN',  trace = FALSE))
}

library(secrdesign)
grid <- make.grid(8, 8, spacing = 40, detector = 'multi')
buffers <- seq(0,200,40)
masks <- lapply(buffers, make.mask, traps = grid, spacing = 10)
nrepl <- 100
customextractfn <- function (fit) {
    c(n = nrow(fit$capthist), N = region.N(fit)[1,1], A = maskarea(fit$mask))
}
results <- array(dim = c(6,6,3,nrepl))
for (i in 1:6) {
    for(j in 1:6) {
        results[i,j,,] <- replicate(nrepl, runone(buffer[i], masks[[j]]))
    }
}
outmn <- apply(results,c(1,2,3), mean)

par(mfrow=c(6,6), mar=c(0,0,1.5,0), oma = c(0,2,2,0))
for (j in 1:6) {   # masks
    for (i in 1:6) {  # pops
        plot(masks[[j]], border=200-buffers[j])
        pop <- sim.popn(core = grid, Nbuffer = 256, Ndist = 'fixed', buffer = buffers[i])
        plot(pop, add=T)
        plot(grid, add=T)
        mtext(side=3, paste0('Nhat = ', round(outmn[i,j,2],1)), cex=0.8)
    }
}
mtext(side=3, outer=TRUE, 'Population extent')
mtext(side=2, outer=TRUE, 'Mask extent')

Murray Efford

unread,
Apr 15, 2025, 1:48:06 AMApr 15
to secr
It's interesting to see what happens when the population occupies only part of the area covered by a dense grid of detectors. Then the estimates of population size (true N 256) using a mask of extent equal to the detectors seem to remain nearly unbiased (Row 1 below; other conditions as before). This is intuitively right if estimates of average density across the mask (and hence population size within the mask) are robust to inhomogeneity of density (including occupancy of only part of the enclosed area). This could be a useful result, given some work to define its limits - it's definitely not robust when the mask extrapolates beyond the grid (Row 2).

extent sims2.png
Reply all
Reply to author
Forward
0 new messages