Region.N seems highly dependent on mask spacing

57 views
Skip to first unread message

jnw...@gmail.com

unread,
Oct 7, 2022, 8:31:53 PM10/7/22
to secr
Hello! I'm interested in using my model results to predict to a slightly larger area (despite all the caveats). Ultimately the goal is to use RSF-type covariates in the mask to better inform the predicted estimates for areas not sampled, but that will come later.

I've noticed that the region.N command gives very different results if the mask has different spacing, even if the boundaries and total area of the masks are the same. For example, I used the example code provided for the secr.fit() function to generate a detection history. I then fit a mask to the trap locations and fit a simple model. I created 3 additional masks that encompass a slightly larger area. One of those 3 has the same spacing. The other two have coarser and finer spacing, respectively.  If I run region.N() on the larger mask with the same spacing as the original mask, the results are as expected (density * area). However, I get very unexpected results for the other two masks, even though the mask summary indicates nearly exact total areas. 

The obvious answer is to make sure the spacings are always the same, but it would be nice to be able to use different spacings for a variety of reasons. Any thoughts? Other than simply not doing this? Thanks!

set.seed(99801)
detectors <- make.grid (nx = 6, ny = 8, detector = "multi")
detections <- sim.capthist (detectors, popn = list(D = 10,
             buffer = 100), detectpar = list(g0 = 0.2, sigma = 25))
mask <- make.mask(traps = traps(detections), type = "trapbuffer", buffer = 150, spacing = 1 )
mask2 <- make.mask(traps = traps(detections), type = "trapbuffer", buffer = 250, spacing = 1 )
mask3 <- make.mask(traps = traps(detections), type = "trapbuffer", buffer = 250, spacing = 5 )
mask4 <- make.mask(traps = traps(detections), type = "trapbuffer", buffer = 250, spacing = 0.5 )

summary(mask) # 15.67 ha
summary(mask2) # 33.03 ha
summary(mask3) # 33.05 ha
summary(mask4) # 33.04 ha

secr0 <- secr.fit (detections, mask = mask)
secr0 # D = 13.88

region.N(secr0, region = mask) # E(N) = 217 (as expected)
region.N(secr0, region = mask2) # E(N) = 458 (as expected)
region.N(secr0, region = mask3) # E(N) = 18
region.N(secr0, region = mask4) # E(N) = 1834


Murray Efford

unread,
Oct 8, 2022, 4:36:50 AM10/8/22
to secr
You have found a simple bug in that corner of region.N. The code used the cell size of the original mask rather than cell size of the region mask. I have fixed this in the version on GitHub, and in principle you can install from there, but it may be simpler to wait a few days for it to find its way onto CRAN.

Now I get -

> region.N(secr0, region = mask) # E(N) = 217 (as expected)
    estimate SE.estimate      lcl      ucl  n
E.N 217.5217    33.33561 161.3655 293.2206 51
R.N 217.5217    29.89550 168.4534 287.0892 51

> region.N(secr0, region = mask2) # E(N) = 458 (as expected)
    estimate SE.estimate      lcl      ucl  n
E.N 458.6269    70.28544 340.2261 618.2319 51
R.N 458.6270    66.94338 347.0749 612.2085 51

> region.N(secr0, region = mask3) # E(N) = 18
    estimate SE.estimate      lcl      ucl  n
E.N 458.8157    70.31437 340.3662 618.4864 51
R.N 458.8158    66.97235 347.2149 612.4630 51

> region.N(secr0, region = mask4) # E(N) = 1834
    estimate SE.estimate      lcl      ucl  n
E.N 458.6269    70.28544 340.2261 618.2319 51
R.N 458.6270    66.94338 347.0749 612.2085 51

Thanks for reporting this.
Murray

jnw...@gmail.com

unread,
Oct 8, 2022, 1:10:39 PM10/8/22
to secr
Thanks for that fix! I was afraid I was doing something incorrectly.

Murray Efford

unread,
Oct 9, 2022, 12:22:45 AM10/9/22
to secr
New version on CRAN now, with Windows binary.
Reply all
Reply to author
Forward
0 new messages